<template>
  <div style="height:100%;width:100%;position:relative;">
    <div class="pagetop" :style="'height:' + topheight + 'px'">
      <div style="width:100%;">
        <el-col>
          <div ref="buttondiv">
            <vxe-toolbar>
              <template v-slot:buttons>
                <table>
                  <tr v-if="isbis">
                    <td>报告单元</td>
                    <td>
                      <rm-ddl-rptunit prgno="LIS110" v-model="search_rptunitid" width="200px"
                        @change="rptunitChange"></rm-ddl-rptunit>
                    </td>
                    <td>快速查找</td>
                    <td>
                      <el-input placeholder="项目代码|名称|缩写|拼音码|外部代码" size="small" style="width:210px;" v-model="seach_keystr"
                        @keyup.enter.native="MainTable_Rfresh()" clearable>
                      </el-input>
                    </td>
                    <td>
                      <el-radio-group v-model="seach_stopflag">
                        <el-radio :label="0" selected @change="MainTable_Rfresh()" size="mini">全部</el-radio>
                        <el-radio :label="1" @change="MainTable_Rfresh()" size="mini">停用</el-radio>
                        <el-radio :label="2" @change="MainTable_Rfresh()" size="mini">在用</el-radio>
                      </el-radio-group>
                    </td>
                    <td :width="buttonwidth"></td>
                    <td style="align:right">
                    </td>
                  </tr>
                  <tr v-if="!isbis">
                    <td>项目类别</td>
                    <td>
                      <rm-ddl-rptitemclass @change="rptitemclassChange" v-model="search_itemclasscode" authflag="1"
                        width="210px"></rm-ddl-rptitemclass>
                    </td>
                    <td>报告单元</td>
                    <td>
                      <rm-ddl-rptunit prgno="LIS110" v-model="search_rptunitid" width="200px"
                        @change="rptunitChange"></rm-ddl-rptunit>
                    </td>
                    <td>项目类型</td>
                    <td>
                      <el-select @change="germflagChange" v-model="seach_germflag" placeholder="请选择" style="width:200px"
                        clearable>
                        <el-option key="0" label="普通项目" value="0"></el-option>
                        <el-option key="1" label="培养阴性结果" value="1"></el-option>
                        <el-option key="5" label="培养阴性过程" value="5"></el-option>
                        <el-option key="2" label="致病菌" value="2"></el-option>
                        <el-option key="3" label="正常菌种" value="3"></el-option>
                        <el-option key="4" label="涂片结果" value="4"></el-option>
                        <el-option key="6" label="基因项目" value="6"></el-option>
                      </el-select>
                    </td>
                    <td :width="buttonwidth"></td>
                    <td style="align:right">
                    </td>
                  </tr>
                  <tr v-if="!isbis">
                    <td>快速查找</td>
                    <td>
                      <el-input placeholder="项目代码|名称|缩写|拼音码|外部代码" size="small" style="max-width:210px;"
                        v-model="seach_keystr" @keyup.enter.native="MainTable_Rfresh()" clearable>
                      </el-input>
                    </td>
                    <td>仪器大类</td>
                    <td>
                      <rm-ddl-common @change="instrclassChange" datatype="seccode" kindno="INSTRCLASS"
                        v-model="seach_instrclass" width="200px"></rm-ddl-common>
                    </td>
                    <td colspan="2">
                      <el-radio-group v-model="seach_stopflag">
                        <el-radio :label="0" selected @change="MainTable_Rfresh()" size="mini">全部</el-radio>
                        <el-radio :label="1" @change="MainTable_Rfresh()" size="mini">停用</el-radio>
                        <el-radio :label="2" @change="MainTable_Rfresh()" size="mini">在用</el-radio>
                      </el-radio-group>
                    </td>
                    <td :width="buttonwidth"></td>
                    <td style="align:right">
                    </td>
                  </tr>
                  <tr>
                    <td :colspan="toolbarspan">
                      <el-button @click="MainTable_Rfresh()" icon="el-icon-search" v-has="'PINQUERY'"
                        type="primary">查询</el-button>
                      <!-- <el-divider direction="vertical"></el-divider> -->
                      <!-- 基本信息 -->
                      <el-button @click="tab_jbxx_addEvent" icon="el-icon-plus" v-bind:style="{ display: tab_jbxx_button }"
                        v-has="'PADD'">新增</el-button>
                      <el-button icon="el-icon-edit" @click="tab_jbxx_editEvent"
                        v-bind:style="{ display: tab_jbxx_button }" v-has="'PMODIFY'">修改</el-button>
                      <el-button @click="tab_jbxx_delete" icon="el-icon-delete" v-bind:style="{ display: tab_jbxx_button }"
                        v-has="'PDELETE'">删除</el-button>
                      <el-button @click="ExportEventDiv = true" icon="el-icon-download"
                        v-bind:style="{ display: tab_jbxx_button }">导出</el-button>
                      <el-button @click="importRptitem" icon="el-icon-upload2"
                        v-bind:style="{ display: tab_jbxx_button }">导入</el-button>
                      <el-button @click="updateUseFrequency" v-bind:style="{ display: tab_jbxx_button }">更新使用频次</el-button>
                      <el-button @click="btnCopyExcode" v-if="IsAreaMode"
                        v-bind:style="{ display: tab_jbxx_button }">复制外部代码</el-button>
                      <div class="upload-button">
                        <el-upload ref="upload" :action="url" accept=".xlsx" :on-change="fileChange"
                          :show-file-list="showFile" :data="updata" :http-request="uploadOpt">
                          <el-button size="small" plain>选择文件</el-button>
                          <!-- <div slot="tip" class="el-upload__tip">只能上传DAT(*dat)文件，且不超过10M</div> -->
                        </el-upload>
                      </div>
                      <!-- 参考值明细 -->
                      <!-- <el-button @click="tab_ckzmx_addEvent" icon="el-icon-plus" v-bind:style="{ display: tab_ckzmx_button}">新增</el-button>
                                          <el-button @click="tab_ckzmx_delete" icon="el-icon-delete" v-bind:style="{ display: tab_ckzmx_button}">删除</el-button> -->

                      <el-button @click="tab_ckzmx_save" icon="el-icon-document"
                        v-bind:style="{ display: tab_ckzmx_button }" style="margin-left: 5px;">保存</el-button>

                      <!-- 文字结果 -->
                      <el-button @click="tab_wzjg_addEvent('', 'M');" icon="el-icon-plus"
                        v-bind:style="{ display: tab_wzjg_button }">新增</el-button>
                      <el-button @click="tab_wzjg_delete" icon="el-icon-delete"
                        v-bind:style="{ display: tab_wzjg_button }">删除</el-button>
                      <el-button @click="tab_wzjg_addPN" icon="el-icon-c-scale-to-original"
                        v-bind:style="{ display: tab_wzjg_button }">阴阳性</el-button>
                      <el-button @click="tab_wzjg_save" icon="el-icon-document"
                        v-bind:style="{ display: tab_wzjg_button }">保存</el-button>
                      <el-button @click="tab_wzjg_export" v-bind:style="{ display: tab_wzjg_button }"
                        icon="el-icon-download">导出</el-button>
                      <el-button size="small" icon="el-icon-upload2" @click="tab_wzjg_import"
                        v-bind:style="{ display: tab_wzjg_button }">导入</el-button>
                      <!-- 临床意义 -->
                      <el-button @click="tab_lcyy_save" icon="el-icon-document"
                        v-bind:style="{ display: tab_lcyy_button }">保存</el-button>
                      <!-- 样本转换 -->
                      <el-button @click="tab_ybzh_addEvent" icon="el-icon-plus"
                        v-bind:style="{ display: tab_ybzh_button }">新增</el-button>
                      <el-button @click="tab_ybzh_delete" icon="el-icon-delete"
                        v-bind:style="{ display: tab_ybzh_button }">删除</el-button>
                      <el-button @click="tab_ybzh_save" icon="el-icon-document"
                        v-bind:style="{ display: tab_ybzh_button }">保存</el-button>
                      <!-- 使用情况 -->
                      <!-- <el-button @click="tab_syqk_addEvent" icon="el-icon-plus" v-bind:style="{ display: tab_syqk_button}">新增</el-button>
                                          <el-button @click="tab_syqk_delete" icon="el-icon-delete" v-bind:style="{ display: tab_syqk_button}">删除</el-button> -->
                      <el-button @click="tab_syqk_save" icon="el-icon-document"
                        v-bind:style="{ display: tab_syqk_button }">保存</el-button>
                      <!-- 互斥项目 -->
                      <el-button @click="tab_pcxm_addEvent" icon="el-icon-plus"
                        v-bind:style="{ display: tab_pcxm_button }">新增</el-button>
                      <el-button @click="tab_pcxm_delete" icon="el-icon-delete"
                        v-bind:style="{ display: tab_pcxm_button }">删除</el-button>
                      <el-button @click="tab_pcxm_save" icon="el-icon-document"
                        v-bind:style="{ display: tab_pcxm_button }">保存</el-button>
                      <!-- 关联项目 -->
                      <el-button @click="tab_glxm_addEvent" icon="el-icon-plus"
                        v-bind:style="{ display: tab_glxm_button }">新增</el-button>
                      <el-button @click="tab_glxm_delete" icon="el-icon-delete"
                        v-bind:style="{ display: tab_glxm_button }">删除</el-button>
                      <el-button @click="tab_glxm_save" icon="el-icon-document"
                        v-bind:style="{ display: tab_glxm_button }">保存</el-button>
                      <!--差值检查-->
                      <el-button @click="tab_czjc_addEvent" icon="el-icon-plus"
                        v-bind:style="{ display: tab_czjc_button }">新增</el-button>
                      <el-button @click="tab_czjc_delete" icon="el-icon-delete"
                        v-bind:style="{ display: tab_czjc_button }">删除</el-button>
                      <el-button @click="tab_czjc_save" icon="el-icon-document"
                        v-bind:style="{ display: tab_czjc_button }">保存</el-button>
                      <!--申请项目-->
                      <el-button @click="tab_sqxm_copy" icon="el-icon-plus"
                        v-bind:style="{ display: tab_sqxm_button }">复制</el-button>
                      <el-button @click="tab_sqxm_paste" icon="el-icon-delete"
                        v-bind:style="{ display: tab_sqxm_button }">粘贴</el-button>
                      <el-button @click="tab_sqxm_addEvent" icon="el-icon-plus"
                        v-bind:style="{ display: tab_sqxm_button }">新增</el-button>
                      <el-button @click="tab_sqxm_delete" icon="el-icon-delete"
                        v-bind:style="{ display: tab_sqxm_button }">删除</el-button>
                      <el-button @click="tab_sqxm_save" icon="el-icon-document"
                        v-bind:style="{ display: tab_sqxm_button }">保存</el-button>
                    </td>
                  </tr>
                </table>
              </template>
            </vxe-toolbar>
          </div>
        </el-col>
      </div>
    </div>
    <div class="pagecenter" :style="'top:' + (topheight + 5) + 'px'">
      <rm-layout-right splitcolor="white" movingcolor="#00ffff" :splitwidth=5 :fixsize=670>
        <template v-slot:fix>
          <el-tabs style="height:100%;" type="border-card" @tab-click="tab_getdata" v-model="tab_showflag"
            class="righttablist">
            <el-tab-pane label="基本信息" style="overflow:scroll;" name="tabname_jbxx">
              <el-form :inline="true" @submit.native.prevent label-width="auto" ref="form" :model="Tab_jbxx_Data">
                <table>
                  <tr>
                    <td>
                      <font color="#F56C6C">项目归类</font>
                    </td>
                    <td colspan="3">
                      <el-input v-model="Tab_jbxx_Data.itemclassname" :readonly="true"></el-input>
                    </td>
                    <td>仪器大类</td>
                    <td>
                      <rm-ddl-common datatype="seccode" kindno="INSTRCLASS" v-model="Tab_jbxx_Data.instrclass"
                        width="105px" :onlyshow="true"></rm-ddl-common>
                    </td>
                    <td>允许CV(%)</td>
                    <td>
                      <el-input style="width:105px;" v-model="Tab_jbxx_Data.qccv" :readonly="true"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      <font color="#F56C6C">英文缩写</font>
                    </td>
                    <td>
                      <el-input style="width:100px;" v-model="Tab_jbxx_Data.itemcode_en" :readonly="true"></el-input>
                    </td>
                    <td>
                      <font color="#F56C6C">项目代码</font>
                    </td>
                    <td>
                      <el-input style="width:96px" v-model="Tab_jbxx_Data.rpt_itemcode" :readonly="true"></el-input>
                    </td>
                    <td>允许TEa(%)</td>
                    <td>
                      <el-input style="width:105px;" v-model="Tab_jbxx_Data.qctea" :readonly="true"></el-input>
                    </td>
                    <td>TEa判断标准</td>
                    <td>
                      <el-input style="width:105px;" v-model="Tab_jbxx_Data.teaflagname" :readonly="true"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      <font color="#F56C6C">中文名称</font>
                    </td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data.rpt_itemname" :readonly="true"></el-input>
                    </td>
                    <td>
                      <font color="#F56C6C">报告代码</font>
                    </td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data.rptcode" :readonly="true"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td>项目备注</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data.itemtips" :readonly="true"></el-input>
                    </td>
                    <td>统计代码</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data.statcode" :readonly="true"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td>英文名称</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data.itemname_en" :readonly="true"></el-input>
                    </td>
                    <td>频次</td>
                    <td colspan="3">
                      <el-input style="width:80px" v-model="Tab_jbxx_Data.seq" :readonly="true"></el-input>&nbsp;&nbsp;
                      <el-checkbox v-model="Tab_jbxx_Data.nostat" :disabled="true">不参与统计</el-checkbox>
                      <el-checkbox v-model="Tab_jbxx_Data.stopflag" :disabled="true">停用</el-checkbox>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      <font color="#F56C6C">结果类型</font>
                    </td>
                    <td>
                      <el-input v-model="Tab_jbxx_Data.resulttype_name" style="width:100px" readonly></el-input>
                    </td>
                    <td>
                      <font color="#F56C6C">小数位数</font>
                    </td>
                    <td>
                      <el-input v-model="Tab_jbxx_Data.dec_digits_name" style="width:96px" readonly></el-input>
                    </td>
                    <td>
                      <font color="#F56C6C">项目类型</font>
                    </td>
                    <td colspan="2">
                      <el-input v-model="Tab_jbxx_Data.germflag_name" style="width:150px" readonly></el-input>
                    </td>
                    <td align="left">
                      <el-checkbox v-model="Tab_jbxx_Data.resulttwice" :disabled="true">结果需复核</el-checkbox>
                    </td>
                  </tr>
                  <tr>
                    <td>单位</td>
                    <td>
                      <el-input style="width:100px" v-model="Tab_jbxx_Data.unit" :readonly="true"></el-input>
                    </td>
                    <td>价格</td>
                    <td>
                      <el-input style="width:96px" v-model="Tab_jbxx_Data.price" :readonly="true"></el-input>
                    </td>
                    <td>申请项目</td>
                    <td colspan="3">
                      <rm-ddl-common datatype="reqitem" v-model="Tab_jbxx_Data.req_itemcode" width="280px"
                        :onlyshow="true"></rm-ddl-common>
                    </td>
                  </tr>
                  <tr>
                    <td>测试方法</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data.testmethod" :readonly="true"></el-input>
                    </td>
                    <td>急诊申请项目</td>
                    <td colspan="3">
                      <rm-ddl-common datatype="reqitem" v-model="Tab_jbxx_Data.req_itemcode_stat" width="280px"
                        :onlyshow="true"></rm-ddl-common>
                    </td>
                  </tr>
                  <tr>
                    <td>输入码</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data.inputcode" :readonly="true"></el-input>
                    </td>
                    <td>Gram(一级分类)</td>
                    <td colspan="3">
                      <el-input v-model="Tab_jbxx_Data.germgram" style="width:80px;" readonly></el-input>&nbsp;&nbsp;
                      <el-checkbox v-model="Tab_jbxx_Data.isgermgroup" disabled="">菌属标志</el-checkbox>
                      <!--<el-checkbox v-model="Tab_jbxx_Data.shareflag" disabled="">互认标志</el-checkbox>-->

                    </td>
                  </tr>
                  <tr>
                    <td>默认取值</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data.defaultval" :readonly="true"></el-input>
                    </td>
                    <td>菌科(二级分类)</td>
                    <td colspan="3">
                      <rm-ddl-common datatype="labgermkind" dataname="菌科(二级分类)" v-model="Tab_jbxx_Data.germkind"
                        width="280px" :onlyshow="true" key="germkind"></rm-ddl-common>
                    </td>
                  </tr>
                  <tr>
                    <td>结果1默认值</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data.defaultresult1" :readonly="true"></el-input>
                    </td>
                    <td>菌属(三级分类)</td>
                    <td colspan="3">
                      <rm-ddl-common datatype="germgroup" dataname="菌属(三级分类)" key="groupitemcode"
                        v-model="Tab_jbxx_Data.groupitemcode" width="280px" :onlyshow="true"></rm-ddl-common>
                    </td>
                  </tr>
                  <tr>
                    <td>结果2默认值</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data.defaultresult2" :readonly="true"></el-input>
                    </td>
                    <td>默认药敏组合</td>
                    <td colspan="3">
                      <rm-ddl-common datatype="labmedgroup" dataname="药敏组合" v-model="Tab_jbxx_Data.germmedgroup"
                        width="280px" :onlyshow="true" key="germmedgroup"></rm-ddl-common>
                    </td>
                  </tr>
                  <tr>
                    <td>结果3默认值</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data.defaultresult3" :readonly="true"></el-input>
                    </td>
                    <td>基因输入模板</td>
                    <td colspan="3">
                      <rm-ddl-common datatype="labgeneinputmdl" dataname="基因输入模板" key="geneinputmdlid"
                        v-model="Tab_jbxx_Data.geneinputmdlid" width="280px" :onlyshow="true"></rm-ddl-common>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      <font color="#F56C6C">默认文字结果标志</font>
                    </td>
                    <td>
                      <el-input v-model="Tab_jbxx_Data.textresultflag_name" readonly></el-input>
                    </td>
                    <td>样本质量</td>
                    <td>
                      <el-input v-model="Tab_jbxx_Data.samplequalityname" :readonly="true"></el-input>
                    </td>
                    <td>计算用默认取值</td>
                    <td colspan="3">
                      <el-input style="width:120px" v-model="Tab_jbxx_Data.defcalcvalue" :readonly="true"></el-input>
                      WhoNet代码<el-input style="width:87px;" v-model="Tab_jbxx_Data.germwhocode"
                        :readonly="true"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      对照项目
                    </td>
                    <td colspan="3">
                      <rm-ddl-common datatype="comprptitem" dataname="对照项目" key="comp_itemcode"
                        v-model="Tab_jbxx_Data.comp_itemcode" width="280px" :onlyshow="true"></rm-ddl-common>
                    </td>
                    <td>
                      编号归类
                    </td>
                    <td>
                      <el-input style="width:120px;" v-model="Tab_jbxx_Data.rptitemgroups" :readonly="true"></el-input>
                    </td>
                    <td>结果互认</td>
                    <td>
                      <el-input v-model="Tab_jbxx_Data.shareflag" :readonly="true" style="width:85px;"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="8">
                      <el-divider content-position="left">
                        <font color="#409EFF">参考/复查值范围</font>
                      </el-divider>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="8" style="text-align:left;">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      <el-checkbox v-model="Tab_jbxx_Data.ref_bysex" :disabled="true">参考范围性别有关</el-checkbox>
                      <el-checkbox v-model="Tab_jbxx_Data.ref_byage" :disabled="true">参考范围年龄有关</el-checkbox>
                      <el-checkbox v-model="Tab_jbxx_Data.ref_byspecimen" :disabled="true">参考范围标本有关</el-checkbox>
                      <el-checkbox v-model="Tab_jbxx_Data.ref_byphysicycle" true-label="1" false-label="0"
                        :disabled="true">参考范围生理周期有关</el-checkbox>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="8" style="text-align:left;">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      <el-checkbox v-model="Tab_jbxx_Data.ref_bydiag" true-label="1" false-label="0"
                        :disabled="true">参考范围诊断有关</el-checkbox>
                      <el-checkbox v-model="Tab_jbxx_Data.ref_bydept" true-label="1" false-label="0"
                        :disabled="true">参考范围科室有关</el-checkbox>
                    </td>
                  </tr>
                  <tr>
                    <td>参考值低值</td>
                    <td>
                      <el-input style="width:95px" v-model="Tab_jbxx_Data.ref_l" type="number"
                        :readonly="true"></el-input>
                    </td>
                    <td>参考值高值</td>
                    <td>
                      <el-input style="width:95px" v-model="Tab_jbxx_Data.ref_h" type="number"
                        :readonly="true"></el-input>
                    </td>
                    <td>参考值显示</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data.ref_text" :readonly="true"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td>需复查低值</td>
                    <td>
                      <el-input style="width:95px" v-model="Tab_jbxx_Data.redo_l" type="number"
                        :readonly="true"></el-input>
                    </td>
                    <td>需复查高值</td>
                    <td>
                      <el-input style="width:95px" v-model="Tab_jbxx_Data.redo_h" type="number"
                        :readonly="true"></el-input>
                    </td>
                    <td colspan="4">

                    </td>
                  </tr>
                  <tr>
                    <td colspan="8" style="text-align:left;">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      复查前后结果比较超出<el-input style="width:60px" v-model="Tab_jbxx_Data.redo_ratio" type="number"
                        :readonly="true"></el-input>%
                      且数值差超出<el-input style="width:60px" v-model="Tab_jbxx_Data.redo_abs" type="number"
                        :readonly="true"></el-input>审核前提醒
                    </td>
                  </tr>
                  <tr>
                    <td colspan="8">
                      <el-divider content-position="left">
                        <font color="#409EFF">审核相关</font>
                      </el-divider>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="4" style="text-align:left;">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      <el-checkbox v-model="Tab_jbxx_Data.autochkflag" :disabled="true">允许自动审核</el-checkbox>
                    </td>
                    <td colspan="4">
                      <el-checkbox v-model="Tab_jbxx_Data.sameflagautochkok"
                        :disabled="true">结果标志和上次相同即自动审核通过</el-checkbox>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="4" style="text-align:left;">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      <el-checkbox v-model="Tab_jbxx_Data.autochk_txtresult" :disabled="true">未列文字结果不可自动审核</el-checkbox>
                    </td>
                    <td colspan="4">
                      <el-checkbox v-model="Tab_jbxx_Data.autochk_qtlt"
                        :disabled="true">包含&lt;&gt;也按数值判断自动审核</el-checkbox>
                    </td>
                  </tr>
                  <tr>
                    <td>自动审核低值</td>
                    <td>
                      <el-input style="width:95px" v-model="Tab_jbxx_Data.autochk_l" type="number"
                        :readonly="true"></el-input>
                    </td>
                    <td>自动审核高值</td>
                    <td>
                      <el-input style="width:95px" v-model="Tab_jbxx_Data.autochk_h" type="number"
                        :readonly="true"></el-input>
                    </td>
                    <td colspan="4">
                    </td>
                  </tr>
                  <tr>
                    <td colspan="8" style="text-align:left;padding-left:33px">
                      <span style="padding-left:7px">两次结果在</span>
                      <el-input style="width:95px" v-model="Tab_jbxx_Data.chklastdays" type="number"
                        :readonly="true"></el-input>&nbsp;&nbsp;&nbsp;天内比较超出&nbsp;
                      <el-input style="width:95px" v-model="Tab_jbxx_Data.chklastratio" type="number"
                        :readonly="true"></el-input>%
                      {{ Tab_jbxx_Data.chkmatchflag == '1' ? '且' : '或' }}数值差超出&nbsp;
                      <el-input style="width:95px" v-model="Tab_jbxx_Data.chklastabs" type="number"
                        :readonly="true"></el-input>审核前提醒
                    </td>
                  </tr>
                  <tr>
                    <td colspan="4" style="text-align:left;">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      <el-checkbox v-model="Tab_jbxx_Data.mustmatchlastflag" :disabled="true">结果标志和上次不同警告</el-checkbox>
                    </td>
                    <td colspan="4">
                      <el-checkbox v-model="Tab_jbxx_Data.mustmatchlast" :disabled="true">结果和上次不同警告</el-checkbox>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="8">
                      <el-divider content-position="left">
                        <font color="#409EFF">危急值</font>
                      </el-divider>
                    </td>
                  </tr>
                  <tr>
                    <td>与上次比较危急值</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data.limit_rule" :readonly="true"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td>危急值分类</td>
                    <td>
                      <el-input style="width:50px" v-model="Tab_jbxx_Data.alertkind" :readonly="true"></el-input>类
                    </td>
                    <td colspan="2">
                      <el-checkbox v-model="Tab_jbxx_Data.autoalert" :disabled="true">危急值自动上报</el-checkbox>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="8" style="text-align:left;padding-left:35px">
                      危&nbsp;急&nbsp;值&nbsp;在&nbsp;&nbsp;&nbsp;<el-input style="width:95px"
                        v-model="Tab_jbxx_Data.alertouthours" type="number" :readonly="true"></el-input>
                      小时内重复出现不再上报(0或空=总是上报，-1=本次住院)
                    </td>
                  </tr>
                  <tr>
                    <td colspan="8">
                      <el-divider content-position="left">
                        <font color="#409EFF">计算公式</font>
                      </el-divider>
                    </td>
                  </tr>
                  <tr>
                    <td>计算公式</td>
                    <td colspan="7">
                      <el-input style="width:620px" readonly v-model="Tab_jbxx_Data.calc_formula"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td>计算公式显示</td>
                    <td colspan="7">
                      <el-input style="width:620px" readonly v-model="Tab_jbxx_Data.calc_formulatext"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td>结果1计算公式</td>
                    <td colspan="7">
                      <el-input style="width:620px" readonly v-model="Tab_jbxx_Data.result1formula"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td>结果2计算公式</td>
                    <td colspan="7">
                      <el-input style="width:620px" readonly v-model="Tab_jbxx_Data.result2formula"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td>结果3计算公式</td>
                    <td colspan="7">
                      <el-input style="width:620px" readonly v-model="Tab_jbxx_Data.result3formula"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="8">
                      <el-divider content-position="left">
                        <font color="#409EFF">外部代码及其它</font>
                      </el-divider>
                    </td>
                  </tr>
                  <tr>
                    <td>外部代码1</td>
                    <td colspan="3">
                      <el-input v-model="Tab_jbxx_Data.externalcode1"
                        readonly></el-input><!-- @dblclick.native="jbxx_open_externalcodeDialog('e1')" --->
                    </td>
                    <td>外部代码4</td>
                    <td colspan="3">
                      <el-input style="width:240px" v-model="Tab_jbxx_Data.externalcode4" readonly></el-input>
                      <!--@dblclick.native="jbxx_open_externalcodeDialog('e4')"-->
                    </td>
                  </tr>
                  <tr>
                    <td>外部代码2</td>
                    <td colspan="3">
                      <el-input v-model="Tab_jbxx_Data.externalcode2" readonly></el-input>
                      <!--@dblclick.native="jbxx_open_externalcodeDialog('e2')"--->
                    </td>
                    <td>外部代码5</td>
                    <td colspan="3">
                      <el-input style="width:240px" v-model="Tab_jbxx_Data.externalcode5" readonly></el-input>
                      <!--@dblclick.native="jbxx_open_externalcodeDialog('e5')"--->
                    </td>
                  </tr>
                  <tr>
                    <td>外部代码3</td>
                    <td colspan="3">
                      <el-input v-model="Tab_jbxx_Data.externalcode3" readonly></el-input>
                    </td>
                    <!--@dblclick.native="jbxx_open_externalcodeDialog('e3')"-->
                  </tr>
                  <tr>
                    <td colspan="8" style="text-align:left;padding-left:20px">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      建议：外部代码1 用作HIS系统对照，代码2 用作体检系统对照，代码3 用作rmlis4的对照
                    </td>
                  </tr>
                  <tr>
                    <td>基准代码</td>
                    <td colspan="8">
                      <el-input style="width:620px" v-model="Tab_jbxx_Data.basecode" readonly></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="8" style="text-align:left;padding-left:50px">
                      结果超出&nbsp;<el-input style="width:95px" v-model="Tab_jbxx_Data.dilutionlimit" type="number"
                        :readonly="true"></el-input>
                      需稀释后测试，默认稀释倍数<el-input style="width:95px" v-model="Tab_jbxx_Data.dilutionrate" type="number"
                        :readonly="true"></el-input>
                    </td>
                  </tr>
                </table>
              </el-form>
            </el-tab-pane>
            <el-tab-pane label="参考值明细" v-if="Tab_ckzmx_style" name="tabname_ckzmx">
              <!-- <vxe-table :data.sync="tab_ckzmx_data" :loading="tab_ckzmx_loading" :keyboard-config="keyConfig" :select-config="{reserve: true}" :sort-config="{trigger: 'cell'}" border height="auto" class="mytablestyle" highlight-current-row highlight-hover-column highlight-hover-row ref="tab_ckzmx_Table" show-overflow size="mini" show-header-overflow resizable :edit-config="{trigger: 'click', mode: 'cell',activeMethod:activeMethod,showStatus:true,showIcon:false}" :edit-rules="tab_ckzmx_validRules" header-align="center" :cell-class-name="cellClassName" @cell-dblclick="diag_icdOpen">
                              <vxe-table-column type="selection" width="40" align="center"></vxe-table-column>
                              <vxe-table-column key="patsex" field="patsex" title="性别" width="43px" :edit-render="{name: 'select',options:patSexOption}">
                              </vxe-table-column>
                              <vxe-table-column key="ageyear1" field="ageyear1" title="年龄1(岁)>=" :edit-render="{name: 'input',autoselect:true}" width="90px">
                              </vxe-table-column>
                              <vxe-table-column key="ageyear2" field="ageyear2" title="年龄2(岁)<=" :edit-render="{name: 'input',autoselect:true}" width="90px">
                              </vxe-table-column>
                              <vxe-table-column key="specimen_code" field="specimen_code" title="标本类型" width="70px" :edit-render="{name: 'select',options:specimenOption}">
                              </vxe-table-column>
                              <vxe-table-column key="diag_icd" field="diag_icd" title="诊断ICD" width="80px" :edit-render="{name: 'select',options:diagicdOption}">
                              </vxe-table-column>
                              <vxe-table-column key="physicycle" field="physicycle" title="生理周期" :edit-render="{name: 'select',options:physicycleOption}" width="70px">
                              </vxe-table-column>
                              <vxe-table-column key="deptno" field="deptno" title="科室" :edit-render="{name: 'select',options:deptOption}" width="70px">
                              </vxe-table-column>
                              <vxe-table-column key="ref_l" field="ref_l" title="参考低值" :edit-render="{name: 'input',autoselect:true, events: {change: ckzmx_keydownEvent}}" width="70px">
                              </vxe-table-column>
                              <vxe-table-column key="ref_h" field="ref_h" title="参考高值" :edit-render="{name: 'input',autoselect:true, events: {change: ckzmx_keydownEvent}}" width="70px">
                              </vxe-table-column>
                              <vxe-table-column key="ref_text" field="ref_text" title="参考值显示" :edit-render="{name: 'input',autoselect:true}" width="80px"></vxe-table-column>
                              <vxe-table-column key="redo_l" field="redo_l" title="需复查低值" :edit-render="{name: 'input',autoselect:true}" width="80px"></vxe-table-column>
                              <vxe-table-column key="redo_h" field="redo_h" title="需复查高值" :edit-render="{name: 'input',autoselect:true}" width="80px"></vxe-table-column>
                              <vxe-table-column key="autochk_l" field="autochk_l" title="自动审核下限" :edit-render="{name: 'input',autoselect:true}" width="80px"></vxe-table-column>
                              <vxe-table-column key="autochk_h" field="autochk_h" title="自动审核上限" :edit-render="{name: 'input',autoselect:true}" width="80px"></vxe-table-column>
                              <vxe-table-column key="seq" field="seq" title="排序" width="50px" :edit-render="{name: 'input',autoselect:true}"></vxe-table-column>
                          </vxe-table> -->

              <div style="height:100%">
                <rm-rptitemref :tableData="tab_ckzmx_data" :key="keys.ckzmxkey" prgno="LIS110" :related="related"
                  rptunitid="" :rpt_itemcode="selrow.rpt_itemcode" ref="tab_ckzmx_Table" :funon="refvaldigitsmatch > 0"
                  :digits="selrow.dec_digits"></rm-rptitemref>
              </div>
            </el-tab-pane>
            <el-tab-pane label="文字结果" name="tabname_wzjg">
              <vxe-table :data.sync="tab_wzjg_data" :loading="tab_wzjg_loading" :select-config="{ reserve: true }"
                :sort-config="{ trigger: 'cell' }" border height="auto" highlight-current-row highlight-hover-column
                highlight-hover-row ref="tab_wzjg_Table" show-overflow size="mini" :row-class-name="wzjgRowClassName"
                show-header-overflow :optimization="{ animat: false }" resizable
                :edit-config="{ trigger: 'click', mode: 'cell', showStatus: true, showIcon: false }"
                :edit-rules="tab_wzjg_validRules" :key="reskey" header-align="center" class="wzjgstyle">
                <vxe-table-column type="selection" width="40" align="center"></vxe-table-column>
                <!-- <vxe-table-column key="rpt_itemcode" field="rpt_itemcode" title="项目代码" width="90px"></vxe-table-column> -->
                <vxe-table-column key="textvalue" field="textvalue" title="文字结果"
                  :edit-render="{ name: 'input', autoselect: true }" width="150px">
                </vxe-table-column>
                <vxe-table-column key="result_flag" field="result_flag" title="结果标志"
                  :edit-render="{ name: 'select', options: result_flagOption }" width="80px">
                </vxe-table-column>
                <vxe-table-column key="canautochk" field="canautochk" title="自动审核" width="70px" align="center">
                  <template v-slot="{ row }">
                    <el-checkbox v-model="row.canautochk" true-label="1" false-label="0"></el-checkbox>
                  </template>
                </vxe-table-column>
                <vxe-table-column key="redoflag" field="redoflag" title="需复查标志" width="70px" align="center">
                  <template v-slot="{ row }">
                    <el-checkbox v-model="row.redoflag" true-label="1" false-label="0"></el-checkbox>
                  </template>
                </vxe-table-column>
                <vxe-table-column key="inputcode" field="inputcode" title="快速输入码"
                  :edit-render="{ name: 'input', autoselect: true }" width="80px"></vxe-table-column>
                <vxe-table-column key="seq" field="seq" title="序号" width="50px"
                  :edit-render="{ name: 'input', autoselect: true }"></vxe-table-column>
                <vxe-table-column key="resultkind" field="resultkind" title="类别"
                  :edit-render="{ name: 'select', options: resultkindOption }" width="70px">
                </vxe-table-column>
                <vxe-table-column key="containtext" field="containtext" title="包含此文字即可" width="110px" align="center">
                  <template v-slot="{ row }">
                    <el-checkbox v-model="row.containtext" true-label="1" false-label="0"></el-checkbox>
                  </template>
                </vxe-table-column>
              </vxe-table>
            </el-tab-pane>
            <el-tab-pane label="临床意义" name="tabname_lcyy">
              <el-input type="textarea" style="width:100%;margin-top:1px;margin-bottom:1px;" height="auto"
                placeholder="请输入内容" v-model="Tab_jbxx_Data.clinicsign" :autosize="{ minRows: 20, maxRows: 99 }">
              </el-input>
            </el-tab-pane>
            <el-tab-pane label="样本转换" name="tabname_ybzh">
              <vxe-table :data.sync="tab_ybzh_data" :loading="tab_ybzh_loading" :select-config="{ reserve: true }"
                :sort-config="{ trigger: 'cell' }" border height="auto" class="mytablestyle" highlight-current-row
                highlight-hover-column highlight-hover-row ref="tab_ybzh_Table" show-overflow size="mini" stripe
                :row-class-name="GetRowClassName" show-header-overflow :optimization="{ animat: false }" resizable
                :edit-config="{ trigger: 'click', mode: 'cell', showStatus: true }" :edit-rules="tab_ybzh_validRules"
                header-align="center">
                <vxe-table-column type="selection" width="40" align="center"></vxe-table-column>
                <vxe-table-column key="specimencode" field="specimencode" title="样本类型" width="130px">
                  <template v-slot="{ row }">
                    <rm-ddl-common datatype="specimen" dataname="标本类型" v-model="row.specimencode" width="100%"
                      :readonly="true" key="specimencode"></rm-ddl-common>
                  </template>
                </vxe-table-column>
                <vxe-table-column key="destrptItemcode" field="destrptItemcode" title="转换后报告项目名称" width="200px">
                  <template v-slot="{ row }">
                    <rm-ddl-rptitem prgno="LIS110" v-model="row.destrptItemcode" :germmode="false" width="100%"
                      :readonly="true"></rm-ddl-rptitem>
                  </template>
                </vxe-table-column>
                <vxe-table-column key="rpt_itemcode" field="destrptItemcode" title="转换后报告项目代码"
                  width="120px"></vxe-table-column>
                <!-- <vxe-table-column key="rpt_itemcode" field="rpt_itemcode" title="当前报告项目代码" width="120px"></vxe-table-column> -->
              </vxe-table>
            </el-tab-pane>
            <el-tab-pane label="使用情况" name="tabname_syqk">
              <vxe-table statusMsgGroup="totest" :data.sync="tab_syqk_data" :loading="tab_syqk_loading"
                :select-config="{ reserve: true }" :sort-config="{ trigger: 'cell' }" border height="50%"
                highlight-current-row highlight-hover-column highlight-hover-row ref="tab_syqk1_Table" show-overflow
                size="mini" stripe :row-class-name="GetRowClassName" show-header-overflow :optimization="{ animat: false }"
                resizable :edit-config="{ trigger: 'click', mode: 'cell', showStatus: false }"
                @current-change="tab_syqk_data_change" header-align="center">
                <vxe-table-column v-if="IsAreaMode" key="hospcode" field="hospcode" title="医院代码"
                  width="80px"></vxe-table-column>
                <vxe-table-column v-if="IsAreaMode" key="hospitalname" field="hospitalname" title="医院名称"
                  width="220px"></vxe-table-column>
                <!-- <vxe-table-column key="rptunitid" field="rptunitid" title="报告单元ID" width="120px"></vxe-table-column> -->
                <vxe-table-column key="rptunitname" field="rptunitname" title="已对照的报告单元" width="220px">
                  <template v-slot="{ row }">
                    {{ row.rptunitname }}[{{ row.rptunitid }}]
                  </template>
                </vxe-table-column>
                <vxe-table-column key="resultcnt" field="resultcnt" title="结果次数" width="100px" header-align="center"
                  align="right"></vxe-table-column>
                <!-- <vxe-table-column key="rpt_itemcode" field="rpt_itemcode" title="报告项目代码" width="120px"></vxe-table-column> -->
                <template v-slot:fix>
                  <div style="font-size:12px;padding-top:3px;background-color:#fff;text-align:left">
                    <table style="border-spacing:10px;width:100%">
                      <tr>
                        <td>
                          <el-button icon="el-icon-search" type="primary" @click="querycensus">统计结果次数</el-button>
                        </td>

                      </tr>
                    </table>
                  </div>
                </template>
              </vxe-table>
              <div style="margin-top:3px;height:50%">
                <div style="height:100%">
                  <rm-rptitemref :tableData="tab_syqk_ckzmx_data" :key="keys.syqkkey" prgno="LIS110_syqk"
                    :related="related" :rpt_itemcode="selrow.rpt_itemcode" :rptunitid="tab_syqk_data_rptunitid"
                    ref="tab_syqk2_Table" :funon="refvaldigitsmatch > 0" :digits="selrow.dec_digits"></rm-rptitemref>
                </div>
              </div>
            </el-tab-pane>
            <el-tab-pane label="互斥项目" name="tabname_pcxm">
              <!--排斥项目-->
              <vxe-table :data.sync="tab_pcxm_data" :loading="tab_pcxm_loading" :select-config="{ reserve: true }"
                :sort-config="{ trigger: 'cell' }" border height="auto" class="mytablestyle" highlight-current-row
                highlight-hover-column highlight-hover-row ref="tab_pcxm_Table" show-overflow size="mini" stripe
                show-header-overflow :optimization="{ animat: false }" resizable
                :edit-config="{ trigger: 'click', mode: 'cell', showStatus: true, showIcon: false }"
                @cell-dblclick="tab_pcxmdblclick" :edit-rules="tab_pcxm_validRules" header-align="center">
                <vxe-table-column type="selection" width="40" align="center"></vxe-table-column>
                <vxe-table-column field="mutex_rptitemcode" title="互斥报告项目代码" width="100px">
                </vxe-table-column>
                <vxe-table-column key="mutex_rptitemcode" field="mutex_rptitemcode" title="互斥报告项目名称" width="220px">
                  <template v-slot="{ row }">
                    <rm-ddl-rptitem prgno="LIS110" v-model="row.mutex_rptitemcode" width="100%" :readonly="true"
                      :mutex_rpt_itemcode="row.rpt_itemcode" @change="mutexrptitemchange"></rm-ddl-rptitem>
                  </template>
                </vxe-table-column>
                <vxe-table-column key="seq" field="seq" title="排序" width="50px" align="center"
                  :edit-render="{ name: 'input', autoselect: true }"></vxe-table-column>
                <vxe-table-column key="rpt_itemcode" field="rpt_itemcode" title="当前报告项目代码"
                  width="100px"></vxe-table-column>
              </vxe-table>
            </el-tab-pane>
            <el-tab-pane label="关联项目" name="tabname_glxm">
              <!--关联项目-->
              <vxe-table :data.sync="tab_glxm_data" :loading="tab_glxm_loading" :select-config="{ reserve: true }"
                :sort-config="{ trigger: 'cell' }" border height="auto" class="mytablestyle" highlight-current-row
                highlight-hover-column highlight-hover-row ref="tab_glxm_Table" show-overflow size="mini" stripe
                show-header-overflow :optimization="{ animat: false }" resizable
                :edit-config="{ trigger: 'click', mode: 'cell', showStatus: true, showIcon: false }"
                @cell-dblclick="tab_glxmdblclick" :edit-rules="tab_glxm_validRules" header-align="center">
                <vxe-table-column type="selection" width="40" align="center"></vxe-table-column>
                <vxe-table-column field="link_rptitemcode" title="关联项目代码" width="100px">
                </vxe-table-column>
                <vxe-table-column key="link_rptitemcode" field="link_rptitemcode" title="关联项目名称" width="220px">
                  <template v-slot="{ row }">
                    <rm-ddl-rptitem prgno="LIS110" v-model="row.link_rptitemcode" width="100%" :readonly="true"
                      :mutex_rpt_itemcode="row.rpt_itemcode" @change="linkrptitemchange"></rm-ddl-rptitem>
                  </template>

                </vxe-table-column>
                <vxe-table-column key="seq" field="seq" title="排序" width="50px" align="center"
                  :edit-render="{ name: 'input', autoselect: true }"></vxe-table-column>
                <vxe-table-column key="rpt_itemcode" field="rpt_itemcode" title="当前报告项目代码"
                  width="100px"></vxe-table-column>
              </vxe-table>
            </el-tab-pane>
            <!-- <el-tab-pane label="文件" name="tabname_wj">文件</el-tab-pane>
                  <el-tab-pane label="基因位点" name="tabname_jywd">基因位点</el-tab-pane>
                  <el-tab-pane label="方法学" name="tabname_ffx">方法学</el-tab-pane>
                  <el-tab-pane label="结果解释" name="tabname_jgjs">结果解释</el-tab-pane>
                  <el-tab-pane label="天然耐药" name="tabname_trny">天然耐药</el-tab-pane> -->
            <el-tab-pane label="差值检查" name="tabname_czjc">
              <vxe-table :data.sync="tab_czjc_data" :loading="tab_czjc_loading" :select-config="{ reserve: true }"
                :sort-config="{ trigger: 'cell' }" border height="auto" class="mytablestyle" highlight-current-row
                highlight-hover-column highlight-hover-row ref="tab_czjc_Table" show-overflow size="mini" stripe
                :optimization="{ animat: false }" resizable
                :edit-config="{ trigger: 'click', mode: 'cell', showStatus: true, showIcon: false }"
                :edit-rules="tab_czjc_validRules" header-align="center">
                <vxe-table-column type="selection" width="40" align="center"></vxe-table-column>
                <vxe-table-column field="lastdays_min" title="结果相差天数1" width="70px"
                  :edit-render="{ name: 'input', autoselect: true }">
                </vxe-table-column>
                <vxe-table-column field="lastdays_max" title="结果相差天数2" width="70px"
                  :edit-render="{ name: 'input', autoselect: true }">
                </vxe-table-column>
                <vxe-table-column field="result_min" title="结果段起始值" width="70px"
                  :edit-render="{ name: 'input', autoselect: true }"></vxe-table-column>
                <vxe-table-column field="result_max" title="结果段结束值" width="70px"
                  :edit-render="{ name: 'input', autoselect: true }"></vxe-table-column>
                <vxe-table-column field="specimen_code" title="适用标本类型" width="100px">
                  <template v-slot="{ row }">
                    <rm-ddl-common datatype="specimen" dataname="标本类型" v-model="row.specimen_code" width="90px"
                      :readonly="true" key="specimen_code"></rm-ddl-common>
                  </template>
                </vxe-table-column>
                <vxe-table-column field="req_deptno" title="适用申请科室" width="110px">
                  <template v-slot="{ row }">
                    <rm-ddl-common datatype="dept" dataname="申请科室" v-model="row.req_deptno" width="100px"
                      :appendtobody="true" :readonly="true"></rm-ddl-common>
                  </template>
                </vxe-table-column>
                <vxe-table-column field="pat_typecode" title="适用病人类型" width="100px">
                  <template v-slot="{ row }">
                    <rm-ddl-common datatype="seccode" kindno="PT" dataname="病人类型" v-model="row.pat_typecode"
                      width="80px"></rm-ddl-common>
                  </template>
                </vxe-table-column>
                <vxe-table-column field="diff_sign" title="变动方向" width="80px"
                  :edit-render="{ name: 'select', options: diff_signOption }"></vxe-table-column>
                <vxe-table-column field="diff_abs" title="变动绝对值" width="70px"
                  :edit-render="{ name: 'input', autoselect: true }"></vxe-table-column>
                <vxe-table-column field="diff_per" title="变动百分比" width="70px"
                  :edit-render="{ name: 'input', autoselect: true }"></vxe-table-column>
                <vxe-table-column field="seq" title="序号" width="50px"></vxe-table-column>
                <vxe-table-column field="autochk_use" title="自动审核使用" width="60px" align="center">
                  <template v-slot="{ row }">
                    <el-checkbox true-label="1" false-label="0" v-model="row.autochk_use"></el-checkbox>
                  </template>
                </vxe-table-column>
                <vxe-table-column field="manualchk_use" title="人工审核使用" width="60px" align="center">
                  <template v-slot="{ row }">
                    <el-checkbox true-label="1" false-label="0" v-model="row.manualchk_use"></el-checkbox>
                  </template>
                </vxe-table-column>
                <vxe-table-column field="stopflag" title="停用标志" width="50px" align="center">
                  <template v-slot="{ row }">
                    <el-checkbox true-label="1" false-label="0" v-model="row.stopflag"></el-checkbox>
                  </template>
                </vxe-table-column>
                <vxe-table-column field="note" title="备注" width="140px"
                  :edit-render="{ name: 'input', autoselect: true }"></vxe-table-column>
                <vxe-table-column field="rpt_itemcode" title="报告项目代码" width="140px">
                  <template v-slot="{ row }">
                    <rm-ddl-rptitem prgno="LIS110" :germmode="false" v-model="row.rpt_itemcode"
                      width="130px"></rm-ddl-rptitem>
                  </template>
                </vxe-table-column>
                <vxe-table-column field="hospcode" title="医院" width="170px">
                  <template v-slot="{ row }">
                    <rm-ddl-common datatype="hospital" dataname="医院" v-model="row.hospcode" width="150px"
                      :disabled="true"></rm-ddl-common>
                  </template>
                </vxe-table-column>
                <vxe-table-column field="deltacheckid" title="DC规则ID" width="80px"></vxe-table-column>
              </vxe-table>
            </el-tab-pane>
            <!--关联项目-->
            <el-tab-pane label="申请项目" name="tabname_sqxm">
              <vxe-table :data.sync="tab_sqxm_data" :loading="tab_sqxm_loading" :select-config="{ reserve: true }"
                :sort-config="{ trigger: 'cell' }" border height="auto" class="mytablestyle" highlight-current-row
                highlight-hover-column highlight-hover-row ref="tab_sqxm_Table" show-overflow size="mini" stripe
                show-header-overflow :optimization="{ animat: false }" resizable
                :edit-config="{ trigger: 'click', mode: 'cell', showStatus: true, showIcon: false }"
                @cell-dblclick="tab_sqxmdblclick" :edit-rules="tab_sqxm_validRules" header-align="center">
                <vxe-table-column type="selection" width="40" align="center"></vxe-table-column>
                <vxe-table-column key="req_itemcode" field="req_itemcode" title="申请项目代码" width="100px">
                </vxe-table-column>
                <vxe-table-column key="req_itemname" field="req_itemname" title="申请项目名称" width="160px"
                  sortable></vxe-table-column>
                <vxe-table-column field="optional" key="optional" title="可选" width="60px" sortable align="center">
                  <template v-slot="{ row }">
                    <el-checkbox v-model="row.optional" true-label="1" false-label="0"></el-checkbox>

                  </template>
                </vxe-table-column>
                <vxe-table-column key="seq" field="seq" title="排序" width="50px" align="center"
                  :edit-render="{ name: 'input', autoselect: true }"></vxe-table-column>
                <vxe-table-column key="rpt_itemcode" field="rpt_itemcode" title="当前报告项目代码" width="160px"
                  sortable></vxe-table-column>
              </vxe-table>
            </el-tab-pane>
          </el-tabs>
        </template>
        <div style="height:100%;width:100%;background-color:#ddccbb;">
          <vxe-table :data.sync="MainTableData" :loading="MainLoading" :select-config="{ reserve: true }"
            :sort-config="{ trigger: 'cell' }" border height="auto" highlight-current-row highlight-hover-column
            header-align="center" highlight-hover-row ref="Main_Table" resizable show-overflow size="mini" stripe
            class="mystyle" @current-change="MainTableChange_Event" :row-class-name="GetRowClassName"
            show-header-overflow>
            <vxe-table-column field="itemclassname" sortable title="项目归类" width="70" show-overflow></vxe-table-column>
            <vxe-table-column field="itemcode_en" sortable title="英文缩写" width="58" show-overflow></vxe-table-column>
            <vxe-table-column field="rpt_itemname" sortable title="报告项目名称" width="120" show-overflow></vxe-table-column>
            <vxe-table-column field="rpt_itemcode" sortable title="报告项目代码" width="90" show-overflow></vxe-table-column>
            <vxe-table-column field="ref_text" sortable title="参考值显示" width="80" show-overflow></vxe-table-column>
            <vxe-table-column field="unit" sortable title="单位" width="50" show-overflow></vxe-table-column>
            <vxe-table-column field="rptcode" sortable title="报告单代码" width="80" show-overflow></vxe-table-column>

            <vxe-table-column field="forbidchk_txtresult" sortable title="未列文字结果禁止审核" width="150" show-overflow
              align="center">
              <template v-slot="{ row }">
                <el-checkbox v-model="row.forbidchk_txtresult" disabled true-label="1" false-label="0"></el-checkbox>
              </template>
            </vxe-table-column>
            <vxe-table-column field="iscalc" sortable title="计算项目" width="70" show-overflow align="center">
              <template v-slot="{ row }">
                <el-checkbox v-model="row.iscalc" disabled true-label="1" false-label="0"></el-checkbox>
              </template>
            </vxe-table-column>
            <vxe-table-column field="calc_formulatext" sortable title="计算公式显示" width="100"
              show-overflow></vxe-table-column>
            <vxe-table-column field="resulttype_name" sortable title="结果类型" width="78" show-overflow></vxe-table-column>
            <vxe-table-column field="rptitemgroups" sortable title="编号归类" width="100" show-overflow
              align="center"></vxe-table-column>
            <vxe-table-column field="dec_digits_name" sortable title="小数位数" width="70" show-overflow></vxe-table-column>
            <vxe-table-column field="instrclass" sortable title="仪器大类" width="70" show-overflow></vxe-table-column>
            <vxe-table-column field="germflag_name" sortable title="项目类型" width="70" show-overflow></vxe-table-column>
            <vxe-table-column field="mutex_no" sortable title="互斥项目数" width="80" show-overflow></vxe-table-column>
            <vxe-table-column field="transpecimen_no" sortable title="样本转换数" width="80" show-overflow></vxe-table-column>
            <vxe-table-column field="itemname_en" sortable title="英文名称" width="70" show-overflow></vxe-table-column>
            <vxe-table-column field="textresultflag_name" sortable title="默认文字结果标志" width="130"
              show-overflow></vxe-table-column>
            <vxe-table-column field="ref_bysex" sortable title="参考值与性别有关" width="130" show-overflow></vxe-table-column>
            <vxe-table-column field="ref_byage" sortable title="参考值与年龄有关" width="130" show-overflow></vxe-table-column>
            <vxe-table-column field="ref_byspecimen" sortable title="参考值与标本有关" width="130"
              show-overflow></vxe-table-column>
            <vxe-table-column field="ref_l" sortable title="参考低值" width="70" show-overflow></vxe-table-column>
            <vxe-table-column field="ref_h" sortable title="参考高值" width="70" show-overflow></vxe-table-column>
            <vxe-table-column field="redo_l" sortable title="需复查低值" width="80" show-overflow></vxe-table-column>
            <vxe-table-column field="redo_h" sortable title="需复查高值" width="80" show-overflow></vxe-table-column>
            <vxe-table-column field="autoalert" sortable title="危急值自动上报" width="110" show-overflow align="center">
              <template v-slot="{ row, rowIndex, columnIndex }">
                <div :key="row.rpt_itemcode + rowIndex + columnIndex" v-if="row.autoalert == '1'">
                  <el-checkbox checked disabled></el-checkbox>
                </div>
                <div :key="row.rpt_itemcode + rowIndex + columnIndex" v-else>
                  <el-checkbox disabled></el-checkbox>
                </div>
              </template>
            </vxe-table-column>
            <vxe-table-column field="price" sortable title="价格" width="50" show-overflow></vxe-table-column>
            <vxe-table-column field="inputcode" sortable title="输入码" width="60" show-overflow></vxe-table-column>
            <vxe-table-column field="externalcode1_name" sortable title="外部代码1" width="80"
              show-overflow></vxe-table-column>
            <vxe-table-column field="externalcode2_name" sortable title="外部代码2" width="80"
              show-overflow></vxe-table-column>
            <vxe-table-column field="externalcode3_name" sortable title="外部代码3" width="80"
              show-overflow></vxe-table-column>
            <vxe-table-column field="mustmatchlast" sortable title="结果不同于上次警告" width="150" show-overflow align="center">
              <template v-slot="{ row, rowIndex, columnIndex }">
                <div :key="row.rpt_itemcode + rowIndex + columnIndex" v-if="row.mustmatchlast == '1'">
                  <el-checkbox checked disabled></el-checkbox>
                </div>
                <div :key="row.rpt_itemcode + rowIndex + columnIndex" v-else>
                  <el-checkbox disabled></el-checkbox>
                </div>
              </template>
            </vxe-table-column>
            <vxe-table-column field="alertouthours" sortable title="危急值时效" width="83" show-overflow></vxe-table-column>
            <vxe-table-column field="hospcode" sortable title="所属院区" width="70" show-overflow></vxe-table-column>
            <vxe-table-column field="stopflag" sortable title="停用" width="50" show-overflow align="center">
              <template v-slot="{ row }">
                <el-checkbox checked disabled v-if="row.stopflag == '1'"></el-checkbox>
                <el-checkbox disabled v-else></el-checkbox>
              </template>
            </vxe-table-column>
            <vxe-table-column field="nostat" sortable title="不统计" width="60" show-overflow align="center">
              <template v-slot="{ row, rowIndex, columnIndex }">
                <div :key="row.rpt_itemcode + rowIndex + columnIndex" v-if="row.nostat == '1'">
                  <el-checkbox checked disabled></el-checkbox>
                </div>
                <div :key="row.rpt_itemcode + rowIndex + columnIndex" v-else>
                  <el-checkbox disabled></el-checkbox>
                </div>
              </template>
            </vxe-table-column>
            <vxe-table-column field="basename" sortable title="基准代码" width="70" show-overflow></vxe-table-column>
            <vxe-table-column field="chklastdays" sortable title="结果和上次比较天数" width="130" show-overflow></vxe-table-column>
            <vxe-table-column field="chklastratio" sortable title="结果和上次比较百分比差" width="160"
              show-overflow></vxe-table-column>
            <vxe-table-column field="chklastabs" sortable title="结果和上次比较数值差" width="150" show-overflow></vxe-table-column>
            <vxe-table-column field="chkmatchflag" sortable title="结果和上次匹配标志" width="150" show-overflow>
              <template v-slot="{ row }">
                <span v-if="row.chkmatchflag == '1'">且</span>
                <span>或</span>
              </template>
            </vxe-table-column>
          </vxe-table>
        </div>
      </rm-layout-right>
    </div>
    <!--参考值显示-->
    <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" title="参考值显示"
      :visible.sync="jbxx_reftext_dialogflag">
      <el-input type="textarea" :rows="10" placeholder="参考值显示" v-model="jbxx_ref_text">
      </el-input>
      <div align="right" style="width:100%;margin-top:10px;">
        <el-button @click="jbxx_reftext_saveevent" icon="el-icon-document">保存</el-button>
        <el-button @click="jbxx_reftext_cancelevent" icon="el-icon-close">取消</el-button>
      </div>
    </el-dialog>
    <!--与上次危机值比较-->
    <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" title="与上次危机值比较"
      :visible.sync="jbxx_limitrules_dialogflag">
      <div>
        <!--病人-->
        <el-input style="width:95px" v-model="jbxx_limitrules_dialogflag_hours" type="number"></el-input>
        小时内结果 <el-select v-model="jbxx_limitrules_dialogflag_change" placeholder="请选择" style="width:100px">
          <el-option key="+" label="升高" value="+"></el-option>
          <el-option key="-" label="降低" value="-"></el-option>
          <el-option key="" label="变化" selected value=""></el-option>
        </el-select>
        超过<el-input style="width:95px" v-model="jbxx_limitrules_dialogflag_cg" type="number"></el-input>
        ，百分比超过<el-input style="width:95px" v-model="jbxx_limitrules_dialogflag_percent" type="number"></el-input>%
      </div>
      <div align="right" style="width:100%;margin-top:10px;">
        <el-button @click="jbxx_limitrules_dialogflag_saveevent" icon="el-icon-document">保存</el-button>
        <el-button @click="jbxx_limitrules_dialogflag_cancelevent" icon="el-icon-close">取消</el-button>
      </div>
    </el-dialog>
    <!--外部代码段-->
    <el-dialog v-el-drag-dialog :append-to-body="true" :visible.sync="jbxx_dialogTable_externalcode"
      :close-on-click-modal="false" @close="jbxx_externalcode_tableData_close" title="外部代码段" width="642px">
      <vxe-toolbar style="margin-bottom:5px;">
        <template v-slot:buttons>
          <el-input class="input-with-select" placeholder="输入查询内容" prefix-icon="el-icon-search" size="small"
            style="max-width:150px;" v-model="jbxx_externalcode_seach"></el-input>
          <el-button @click="jbxx_externalcode_seachEvent" icon="el-icon-search" size="small" slot="append">查询</el-button>
        </template>
      </vxe-toolbar>
      <vxe-table :data.sync="jbxx_externalcode_tableData" :select-config="{ reserve: true }"
        :sort-config="{ trigger: 'cell' }" @cell-dblclick="jbxx_externalcode_dbclick($event)" border height="300"
        highlight-current-row highlight-hover-column highlight-hover-row resizable show-overflow size="mini" stripe
        header-align="center">
        <vxe-table-column field="rptitemcode" sortable title="项目代码" width="100"></vxe-table-column>
        <vxe-table-column field="rptitemname" sortable title="项目名称" width="100"></vxe-table-column>
        <vxe-table-column field="comment1" sortable title="备用字段1" width="100"></vxe-table-column>
        <vxe-table-column field="comment2" sortable title="备用字段2" width="100"></vxe-table-column>
        <vxe-table-column field="inputcode" sortable title="助记符" width="100"></vxe-table-column>
        <vxe-table-column field="externalmode" sortable title="来源类别" width="100"></vxe-table-column>
      </vxe-table>
    </el-dialog>
    <!--危机时效对应科室-->
    <el-dialog title="危机时效对应科室" :visible.sync="jbxx_outhours_dialogflag" width="500px" v-el-drag-dialog
      :append-to-body="true" :close-on-click-modal="false">
      <vxe-table :data.sync="tab_jbxx_outhoursdata" :select-config="{ reserve: true }" :sort-config="{ trigger: 'cell' }"
        border height="300px" highlight-current-row highlight-hover-column highlight-hover-row
        ref="tab_jbxx_outhoursdata_ref" show-overflow size="mini" stripe :row-class-name="GetRowClassName"
        show-header-overflow :optimization="{ animat: false }" resizable
        :edit-config="{ trigger: 'click', mode: 'cell', showStatus: true }" :edit-rules="tab_jbxx_outhours_validRules"
        :edit-changing="jbxx_outhours_dialog_editchange">
        <vxe-table-column type="selection" width="40" align="center"></vxe-table-column>
        <vxe-table-column field="req_deptno" sortable title="项目名称" width="220">
          <template v-slot="{ row }">
            <rm-ddl-common datatype="dept" dataname="申请科室" v-model="row.req_deptno" width="200px"
              :appendtobody="true"></rm-ddl-common>
          </template>
        </vxe-table-column>
        <vxe-table-column key="alertouthours" field="alertouthours" title="危机时效数"
          :edit-render="{ name: 'input', autoselect: true }" width="120px"></vxe-table-column>
      </vxe-table>
      <vxe-toolbar style="margin-top:5px;text-align:right;">
        <template v-slot:buttons>
          <el-button @click="tab_jbxx_outhours_addEvent" icon="el-icon-plus">增加</el-button>
          <el-button @click="tab_jbxx_outhours_delEvent" icon="el-icon-delete">删除</el-button>
          <el-button @click="tab_jbxx_outhours_saveEvent" icon="el-icon-document">保存</el-button>
          <el-button @click="tab_jbxx_outhours_canelEvent" icon="el-icon-close">取消</el-button>
        </template>
      </vxe-toolbar>
    </el-dialog>
    <!--计算项目计算公式向导-->
    <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" title="计算项目计算公式向导"
      :visible.sync="jbxx_iscalc_dialogflag" width="950px" @close="jbxx_iscalc_dialogclose">
      <div style="height:590px;">
        <div>
          <el-input type="textarea" style="width:100%;" height="auto" :disabled="true" resize="none"
            v-model="jbxx_s_calc_formulatext" :autosize="{ minRows: 4, maxRows: 6 }">
          </el-input>
        </div>
        <div>
          <el-input id="jbxx_calc_formula_id" type="textarea" style="width:100%;" height="auto" resize="none"
            v-model="jbxx_s_calc_formula" :autosize="{ minRows: 4, maxRows: 6 }" @change="jbxx_iscalc_formula_textchange">
          </el-input>
        </div>
        <div style="float:left">
          <div style="height:380px;float:left;margin-top:5px;">
            <div style="height:30px;">
              <el-input class="input-with-select" placeholder="输入查询内容" prefix-icon="el-icon-search" size="small"
                style="max-width:250px;" v-model="jbxx_iscalc_seach"
                @keyup.enter.native="jbxx_iscalc_getdata()"></el-input>
              <el-button @click="jbxx_iscalc_getdata" icon="el-icon-search" size="small" slot="append">查询</el-button>
            </div>
            <div style="height:390px;width:480px;">
              <vxe-table :data.sync="jbxx_iscalc_data" :loading="jbxx_iscalc_loading" :select-config="{ reserve: true }"
                :sort-config="{ trigger: 'cell' }" border height="auto" highlight-current-row highlight-hover-column
                highlight-hover-row ref="Main_Table" resizable show-overflow size="mini" stripe show-header-overflow
                :optimization="{ animat: false }" @cell-dblclick="jbxx_iscalc_data_dbclick" header-align="center">
                <vxe-table-column field="itemcode_en" sortable title="英文缩写" width="70" show-overflow></vxe-table-column>
                <vxe-table-column field="rpt_itemname" sortable title="报告项目名称" width="150"
                  show-overflow></vxe-table-column>
                <vxe-table-column field="itemclassname" sortable title="项目归类" width="60" show-overflow></vxe-table-column>
                <vxe-table-column field="instrclassname" sortable title="仪器大类" width="60"
                  show-overflow></vxe-table-column>
                <vxe-table-column field="rpt_itemcode" sortable title="报告项目代码" width="90"
                  show-overflow></vxe-table-column>
              </vxe-table>
            </div>
          </div>
        </div>
        <div style="float:left;margin-left:20px;margin-top:30px;">
          <table>
            <tr>
              <td>
                <el-button style="width:80px;margin-bottom:5px;" @click="jbxx_iscalc_addevent(' + ');">+</el-button>
              </td>
              <td>
                <el-button style="width:80px;margin-left:10px;margin-bottom:5px;"
                  @click="jbxx_iscalc_addevent(' - ');">-</el-button>
              </td>
              <td>
                <el-button style="width:80px;margin-left:10px;margin-bottom:5px;"
                  @click="jbxx_iscalc_addevent(' * ');">*</el-button>
              </td>
              <td>
                <el-button style="width:80px;margin-left:10px;margin-bottom:5px;"
                  @click="jbxx_iscalc_addevent(' / ');">/</el-button>
              </td>
            </tr>
            <tr>
              <td>
                <el-button style="width:80px;margin-bottom:5px;" @click="jbxx_iscalc_addevent(' ( ');">(</el-button>
              </td>
              <td>
                <el-button style="width:80px;margin-left:10px;margin-bottom:5px;"
                  @click="jbxx_iscalc_addevent(' ) ');">)</el-button>
              </td>
              <td>
                <el-button style="width:80px;margin-left:10px;margin-bottom:5px;"
                  @click="jbxx_iscalc_addevent('SEX1');">性别男</el-button>
              </td>
              <td>
                <el-button style="width:80px;margin-left:10px;margin-bottom:5px;"
                  @click="jbxx_iscalc_addevent('SEX2');">性别女</el-button>
              </td>
            </tr>
            <tr>
              <td>
                <el-button style="width:80px;margin-bottom:5px;" @click="jbxx_iscalc_addevent(' [AGE] ');">年龄</el-button>
              </td>
              <td>
                <el-button style="width:80px;margin-left:10px;margin-bottom:5px;"
                  @click="jbxx_iscalc_specimen_dialogflag = true;">标本类型</el-button>
              </td>
              <td>
                <el-button style="width:80px;margin-left:10px;margin-bottom:5px;"
                  @click="jbxx_iscalc_dept_dialogflag = true;">申请科室</el-button>
              </td>
              <td>
                <el-button style="width:80px;margin-left:10px;margin-bottom:5px;"
                  @click="jbxx_iscalc_ward_dialogflag = true;">申请病区</el-button>
              </td>
            </tr>
            <tr>
              <td>
                <!--暂时注释，之后可能有用，LIS6有，但LIS7310未有验证-->
                <!-- <el-button style="width:80px;margin-bottom:5px;" @click="jbxx_iscalc_addevent(' [REQ_REASON] ');">送检目的</el-button> -->
              </td>
              <!-- <td> -->
              <!--暂时注释，之后可能有用，LIS6有，但LIS7310未有验证-->
              <!-- <el-button style="width:80px;margin-left:10px;margin-bottom:5px;" @click="jbxx_iscalc_addevent(' [PAT_TYPECODE] ');">病人类型</el-button> -->
              <!-- </td> -->
              <td>
                <el-button style="width:80px;margin-left:10px;margin-bottom:5px;"
                  @click="jbxx_iscalc_addevent('pat_diag');">诊断名称</el-button>
              </td>
              <td>
                <el-button style="width:80px;margin-left:10px;margin-bottom:5px;"
                  @click="jbxx_iscalc_hospital_dialogflag = true;">送检医院</el-button>
              </td>
              <td>
                <el-button style="width:80px;margin-left:10px;margin-bottom:5px;padding: 6px 1px !important;"
                  type="primary" @click="jbxx_iscalcGuide_show">常用公式向导</el-button>
              </td>
            </tr>
            <tr>
              <td colspan="4">
                <el-divider content-position="left">
                  <font color="#409EFF">说明</font>
                </el-divider>
              </td>
            </tr>
            <tr>
              <td colspan="4" style="text-align:left;">
                1：计算公式中不可包括其它计算项目，若有需要，一律转化为<br>最原始的计算公式
              </td>
            </tr>
            <tr>
              <td colspan="4" style="text-align:left;">
                2：所有项目代号必须使用“[”和“]”括起来
              </td>
            </tr>
            <tr>
              <td colspan="4" style="text-align:left;">
                3：表达式可以为一个常数或空字符串
              </td>
            </tr>
            <tr>
              <td colspan="4">
                <el-divider content-position="left">
                </el-divider>
              </td>
            </tr>
            <tr>
              <td colspan="4" style="text-align:right;">
                <el-button @click="jbxx_iscalc_dialogflag_saveevent" icon="el-icon-document">确定</el-button>
                <el-button @click="jbxx_iscalc_dialogflag_cancelevent" icon="el-icon-close">取消</el-button>
                <el-button @click="calctest = { teststr: '', testvalue: '' }, jbxx_iscalctest_dialog = true"
                  icon="el-icon-question">帮助</el-button>
              </td>
            </tr>
          </table>
        </div>
      </div>
    </el-dialog>
    <!--标本类型--->
    <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" title="请选择标本类型"
      :visible.sync="jbxx_iscalc_specimen_dialogflag">
      <rm-pop-common @change="jbxx_iscalc_specimen_change" @cancel="jbxx_iscalc_specimen_dialogflag = false;"
        datatype="specimen"></rm-pop-common>
    </el-dialog>
    <!--申请科室-->
    <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" title="请选择申请科室"
      :visible.sync="jbxx_iscalc_dept_dialogflag">
      <rm-pop-common @change="jbxx_iscalc_dept_change" @cancel="jbxx_iscalc_dept_dialogflag = false;"
        datatype="dept"></rm-pop-common>
    </el-dialog>
    <!--申请病区-->
    <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" title="请选择申请病区"
      :visible.sync="jbxx_iscalc_ward_dialogflag">
      <rm-pop-common @change="jbxx_iscalc_ward_change" @cancel="jbxx_iscalc_ward_dialogflag = false;"
        datatype="ward"></rm-pop-common>
    </el-dialog>
    <!--送检医院-->
    <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" title="请选择送检医院"
      :visible.sync="jbxx_iscalc_hospital_dialogflag">
      <rm-pop-common @change="jbxx_iscalc_hospital_change" @cancel="jbxx_iscalc_hospital_dialogflag = false;"
        datatype="hospital"></rm-pop-common>
    </el-dialog>
    <!--基本信息新增、修改弹窗-->
    <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" :title="main_dialog_name"
      :visible.sync="main_dialogflag" width="830px">
      <div style="height:530px;position:relative;width:100%" :key="main_dialogkey">
        <el-form ref="form" :model="Tab_jbxx_Data_dialog">
          <el-tabs type="border-card" v-model="anchor" style="height:100%;width:100%;position:absolute"
            @tab-click="handleClick">
            <el-tab-pane label="基本信息" name="anchor-0">
              <div style="width:100%" class="scroll_title">
                <table style="border:1px solid #FFFFFF">
                  <tr>
                    <td>
                      <font color="#F56C6C">项目归类</font>
                    </td>
                    <td colspan="3">
                      <rm-ddl-rptitemclass v-model="Tab_jbxx_Data_dialog.itemclasscode" width="280px" :appendtobody="true"
                        ref="itemclass" authflag="1"></rm-ddl-rptitemclass>
                    </td>
                    <td>仪器大类</td>
                    <td>
                      <rm-ddl-common datatype="seccode" kindno="INSTRCLASS" v-model="Tab_jbxx_Data_dialog.instrclass"
                        width="100px" :appendtobody="true" key="dialoginstrclass"> </rm-ddl-common>
                    </td>
                    <td>允许CV(%)</td>
                    <td>
                      <el-input style="width:105px;" v-model="Tab_jbxx_Data_dialog.qccv"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      <font color="#F56C6C">英文缩写</font>
                    </td>
                    <td>
                      <el-input style="width:100%;" v-model.trim="Tab_jbxx_Data_dialog.itemcode_en"
                        @change="English_sm"></el-input>
                    </td>
                    <td>
                      <font color="#F56C6C">项目代码</font>
                    </td>
                    <td>
                      <el-input style="width:100%;" v-model.trim="Tab_jbxx_Data_dialog.rpt_itemcode"
                        @change="jbxx_rptitemcode_change" :disabled="jbxx_rptitemcode_readonly">
                      </el-input>
                    </td>
                    <td>允许TEa(%)</td>
                    <td>
                      <el-input style="width:100px;" v-model="Tab_jbxx_Data_dialog.qctea"></el-input>
                    </td>
                    <td>TEa判断标准</td>
                    <td>
                      <el-select v-model="Tab_jbxx_Data_dialog.teaflag" placeholder="请选择" style="width:105px;">
                        <el-option key="0" label="1/2Tea" value="0"></el-option>
                        <el-option key="1" label="1/3TEa" value="1"></el-option>
                        <el-option key="2" label="定性" value="2"></el-option>
                      </el-select>

                    </td>
                  </tr>
                  <tr>
                    <td>
                      <font color="#F56C6C">中文名称</font>
                    </td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model.trim="Tab_jbxx_Data_dialog.rpt_itemname"
                        @change="getInputCode(Tab_jbxx_Data_dialog.rpt_itemname)"></el-input>
                    </td>
                    <td>
                      <font color="#F56C6C">报告代码</font>
                    </td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model.trim="Tab_jbxx_Data_dialog.rptcode"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td>项目备注</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data_dialog.itemtips"></el-input>
                    </td>
                    <td>统计代码</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data_dialog.statcode"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td>英文名称</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data_dialog.itemname_en"></el-input>
                    </td>
                    <td>频次</td>
                    <td colspan="3">
                      <el-input style="width:80px" v-model="Tab_jbxx_Data_dialog.seq"
                        :disabled="jbxx_seq_readonly"></el-input>&nbsp;&nbsp;
                      <el-checkbox v-model="Tab_jbxx_Data_dialog.nostat">不参与统计</el-checkbox>
                      <el-checkbox v-model="Tab_jbxx_Data_dialog.stopflag">停用</el-checkbox>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      <font color="#F56C6C">结果类型</font>
                    </td>
                    <td style="width:110px">
                      <el-select v-model="Tab_jbxx_Data_dialog.resulttype" placeholder="请选择" style="width:100%">
                        <el-option key="1" label="数值型" value="1"></el-option>
                        <el-option key="2" label="文字型" value="2"></el-option>
                        <el-option key="3" label="阴阳性" value="3"></el-option>
                        <el-option key="4" label="数字文字混合" value="4"></el-option>
                      </el-select>
                    </td>
                    <td>
                      <font color="#F56C6C">小数位数</font>
                    </td>
                    <td style="width:110px">
                      <el-select v-model="Tab_jbxx_Data_dialog.dec_digits" placeholder="请选择" style="width:100%">
                        <el-option key="-1" label="保留原始结果" value="-1"></el-option>
                        <el-option key="0" label="0位" value="0"></el-option>
                        <el-option key="1" label="1位" value="1"></el-option>
                        <el-option key="2" label="2位" value="2"></el-option>
                        <el-option key="3" label="3位" value="3"></el-option>
                        <el-option key="4" label="4位" value="4"></el-option>
                        <el-option key="-2" label="科学计数法(3位指数)" value="-2"></el-option>
                        <el-option key="-3" label="科学计数法(2位指数)" value="-3"></el-option>
                      </el-select>
                    </td>
                    <td>
                      <font color="#F56C6C">项目类型</font>
                    </td>
                    <td colspan="2">
                      <el-select v-model="Tab_jbxx_Data_dialog.germflag" placeholder="请选择" style="width:150px">
                        <el-option key="0" label="普通项目" value="0"></el-option>
                        <el-option key="1" label="培养阴性结果" value="1"></el-option>
                        <el-option key="5" label="培养阴性过程" value="5"></el-option>
                        <el-option key="2" label="致病菌" value="2"></el-option>
                        <el-option key="3" label="正常菌种" value="3"></el-option>
                        <el-option key="4" label="涂片结果" value="4"></el-option>
                        <el-option key="6" label="基因项目" value="6"></el-option>
                      </el-select>
                    </td>
                    <td>
                      <el-checkbox v-model="Tab_jbxx_Data_dialog.resulttwice">结果需复核</el-checkbox>
                    </td>
                  </tr>
                  <tr>
                    <td>单位</td>
                    <td>
                      <el-autocomplete class="inline-input" v-model="Tab_jbxx_Data_dialog.unit"
                        :fetch-suggestions="querySearch" placeholder="请输入内容" @select="handleSelect">
                      </el-autocomplete>
                    </td>
                    <td>价格</td>
                    <td>
                      <el-input style="width:100%" v-model="Tab_jbxx_Data_dialog.price"></el-input>
                    </td>
                    <td>申请项目</td>
                    <td colspan="3">
                      <rm-ddl-common datatype="reqitem" v-model="Tab_jbxx_Data_dialog.req_itemcode" width="280px"
                        :appendtobody="true" key="dialogreq_itemcode"></rm-ddl-common>
                    </td>
                  </tr>
                  <tr>
                    <td>测试方法</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data_dialog.testmethod"></el-input>
                    </td>
                    <td>急诊申请项目</td>
                    <td colspan="3">
                      <rm-ddl-common datatype="reqitem" v-model="Tab_jbxx_Data_dialog.req_itemcode_stat" width="280px"
                        :appendtobody="true" key="dialogreq_itemcode_stat"></rm-ddl-common>
                    </td>
                  </tr>
                  <tr>
                    <td>输入码</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data_dialog.inputcode"></el-input>
                    </td>
                    <td>Gram(一级分类)</td>
                    <td colspan="3">
                      <el-select v-model="Tab_jbxx_Data_dialog.germgram" style="width:80px;" disabled>
                        <el-option v-for="(item, index) in $opt.gramOption" :key="index" :value="item.value"
                          :label="item.label"></el-option>
                      </el-select>&nbsp;&nbsp;
                      <el-checkbox v-model="Tab_jbxx_Data_dialog.isgermgroup"
                        @change="isgermgroupChange">菌属标志</el-checkbox>
                      <!--<el-checkbox v-model="Tab_jbxx_Data_dialog.shareflag">互认标志</el-checkbox>-->

                    </td>
                  </tr>
                  <tr>
                    <td>默认取值</td>
                    <td colspan="3">
                      <el-select v-if="haswzjg == '1'" v-model="Tab_jbxx_Data_dialog.defaultval" style="width:280px;"
                        filterable clearable @blur="SelectInputChange">
                        <el-option v-for="(item, index) in this.wzjgOption" :key="index" :value="item.textvalue"
                          :label="item.textvalue"></el-option>
                      </el-select>
                      <el-input v-else style="width:280px" v-model="Tab_jbxx_Data_dialog.defaultval"></el-input>
                    </td>
                    <td>菌科(二级分类)</td>
                    <td colspan="3">
                      <rm-ddl-common datatype="labgermkind" dataname="菌科(二级分类)" v-model="Tab_jbxx_Data_dialog.germkind"
                        width="280px" :appendtobody="true" key="dialoggermkind" :disabled="disabledKindGroup"
                        @change="germkindChange"></rm-ddl-common>
                    </td>
                  </tr>
                  <tr>
                    <td>结果1默认值</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data_dialog.defaultresult1"></el-input>
                    </td>
                    <td>菌属(三级分类)</td>
                    <td colspan="3">
                      <rm-ddl-common datatype="germgroup" dataname="菌属(三级分类)" v-model="Tab_jbxx_Data_dialog.groupitemcode"
                        width="280px" :appendtobody="true" key="dialoggroupitemcode" readonly
                        :disabled="!disabledKindGroup" @change="germgroupChange"></rm-ddl-common>
                    </td>
                  </tr>
                  <tr>
                    <td>结果2默认值</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data_dialog.defaultresult2"></el-input>
                    </td>
                    <td>默认药敏组合</td>
                    <td colspan="3">
                      <rm-ddl-common datatype="labmedgroup" dataname="药敏组合" v-model="Tab_jbxx_Data_dialog.germmedgroup"
                        width="280px" :appendtobody="true" key="dialoggermmedgroup"></rm-ddl-common>
                    </td>
                  </tr>
                  <tr>
                    <td>结果3默认值</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data_dialog.defaultresult3"></el-input>
                    </td>
                    <td>基因输入模板</td>
                    <td colspan="3">
                      <rm-ddl-common datatype="labgeneinputmdl" dataname="基因输入模板"
                        v-model="Tab_jbxx_Data_dialog.geneinputmdlid" width="280px" :appendtobody="true"
                        key="dialoggeneinputmdlid">
                      </rm-ddl-common>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      <font color="#F56C6C">默认文字结果标志</font>
                    </td>
                    <td>
                      <el-select v-model="Tab_jbxx_Data_dialog.textresultflag" placeholder="请选择">
                        <el-option key="M" label="正常[M]" value="M"></el-option>
                        <el-option key="H" label="偏高[H]" value="H"></el-option>
                        <el-option key="L" label="偏低[L]" value="L"></el-option>
                        <el-option key="P" label="阳性[P]" value="P"></el-option>
                        <el-option key="Q" label="弱阳性[Q]" value="Q"></el-option>
                        <el-option key="E" label="错误[E]" value="E"></el-option>
                        <el-option key="N" label="阴性[N]" value="N"></el-option>
                      </el-select>
                    </td>
                    <td>样本质量</td>
                    <td>
                      <el-select v-model="Tab_jbxx_Data_dialog.samplequality" placeholder="请选择" clearable>
                        <el-option :key="index" v-for="(item, index) in $opt.samplequalityOption" :label="item.label"
                          :value="item.value"></el-option>
                      </el-select>
                    </td>
                    <td>计算用默认取值</td>
                    <td colspan="3">
                      <el-input style="width:100px" v-model="Tab_jbxx_Data_dialog.defcalcvalue"></el-input>
                      WhoNet代码 <el-input style="width:105px;" v-model="Tab_jbxx_Data_dialog.germwhocode"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      对照项目
                    </td>
                    <td colspan="3">
                      <rm-ddl-common datatype="comprptitem" dataname="对照项目" v-model="Tab_jbxx_Data_dialog.comp_itemcode"
                        width="280px" :appendtobody="true" key="dialogcomp_itemcode"
                        @change="compitemcodeChange"></rm-ddl-common>
                    </td>
                    <td>
                      编号归类
                    </td>
                    <td>
                      <el-input style="width:100px;" v-model="Tab_jbxx_Data_dialog.rptitemgroups"></el-input>
                    </td>
                    <td>结果互认</td>
                    <td>
                      <el-input v-model="Tab_jbxx_Data_dialog.shareflag" style="width:105px;"></el-input>
                    </td>
                  </tr>

                </table>
              </div>
            </el-tab-pane>
            <el-tab-pane label="参考/复查值范围" name="anchor-1">
              <div style="width:100%" class="scroll_title">
                <table border="0">
                  <tr>
                    <td colspan="8" style="text-align:left;">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      <el-checkbox v-model="Tab_jbxx_Data_dialog.ref_bysex"
                        @change="iscancelchk($event, 'sex')">参考范围性别有关</el-checkbox>
                      <el-checkbox v-model="Tab_jbxx_Data_dialog.ref_byage"
                        @change="iscancelchk($event, 'age')">参考范围年龄有关</el-checkbox>
                      <el-checkbox v-model="Tab_jbxx_Data_dialog.ref_byspecimen"
                        @change="iscancelchk($event, 'specimen')">参考范围标本有关</el-checkbox>
                      <el-checkbox v-model="Tab_jbxx_Data_dialog.ref_byphysicycle" true-label="1" false-label="0"
                        @change="iscancelchk($event, 'physicycle')">参考范围生理周期有关
                      </el-checkbox>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="8" style="text-align:left;">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      <el-checkbox v-model="Tab_jbxx_Data_dialog.ref_bydiag" true-label="1" false-label="0"
                        @change="iscancelchk($event, 'diag')">参考范围诊断有关</el-checkbox>
                      <el-checkbox v-model="Tab_jbxx_Data_dialog.ref_bydept" true-label="1" false-label="0"
                        @change="iscancelchk($event, 'dept')">参考范围科室有关</el-checkbox>
                    </td>
                  </tr>
                  <tr>
                    <td>参考值低值</td>
                    <td>
                      <el-input style="width:95px" v-model="Tab_jbxx_Data_dialog.ref_l" @input="jbxx_ref_change()"
                        type="number"></el-input>
                    </td>
                    <td>参考值高值</td>
                    <td>
                      <el-input style="width:95px" v-model="Tab_jbxx_Data_dialog.ref_h" @input="jbxx_ref_change()"
                        type="number"></el-input>
                    </td>
                    <td>参考值显示</td>
                    <td colspan="3">
                      <el-input type="text" style="width:280px" v-model="Tab_jbxx_Data_dialog.ref_text"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td>需复查低值</td>
                    <td>
                      <el-input style="width:95px" v-model="Tab_jbxx_Data_dialog.redo_l" type="number"></el-input>
                    </td>
                    <td>需复查高值</td>
                    <td>
                      <el-input style="width:95px" v-model="Tab_jbxx_Data_dialog.redo_h" type="number"></el-input>
                    </td>
                    <td colspan="4">
                      <el-button size="small"
                        @click="jbxx_reftextFun(Tab_jbxx_Data_dialog.ref_text)">多行参考值向导...</el-button>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="8" style="text-align:left;">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      复查前后结果比较超出<el-input style="width:60px" v-model="Tab_jbxx_Data_dialog.redo_ratio"
                        type="number"></el-input>%
                      且数值差超出<el-input style="width:60px" v-model="Tab_jbxx_Data_dialog.redo_abs"
                        type="number"></el-input>审核前提醒
                    </td>
                  </tr>
                </table>
              </div>
            </el-tab-pane>
            <el-tab-pane label="审核相关" name="anchor-2">
              <div style="width:100%" class="scroll_title">
                <table>
                  <tr>
                    <td colspan="4" style="text-align:left;">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      <el-checkbox v-model="Tab_jbxx_Data_dialog.autochkflag">允许自动审核</el-checkbox>

                    </td>
                    <td colspan="4">
                      <el-checkbox v-model="Tab_jbxx_Data_dialog.sameflagautochkok">结果标志和上次相同即自动审核通过</el-checkbox>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="4" style="text-align:left;">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      <el-checkbox v-model="Tab_jbxx_Data_dialog.autochk_txtresult">未列文字结果不可自动审核</el-checkbox>
                    </td>
                    <td>
                      <el-checkbox v-model="Tab_jbxx_Data_dialog.autochk_qtlt">包含&lt;&gt;也按数值判断自动审核</el-checkbox>
                    </td>
                  </tr>
                  <tr>
                    <td style="text-align:left;">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;自动审核低值
                    </td>
                    <td style="text-align:left;">
                      <el-input style="width:95px" v-model="Tab_jbxx_Data_dialog.autochk_l" type="number"></el-input>
                      <!--oninput="value=value.replace(/[^\-?\d.]/g,'')"-->
                      自动审核高值 <el-input style="width:95px" v-model="Tab_jbxx_Data_dialog.autochk_h"
                        type="number"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="8" style="text-align:left;">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      两&nbsp;次&nbsp;结&nbsp;果&nbsp;在<el-input style="width:95px" v-model="Tab_jbxx_Data_dialog.chklastdays"
                        type="number"></el-input>
                      天内比较超出
                      <el-input style="width:95px" v-model="Tab_jbxx_Data_dialog.chklastratio" type="number"></el-input>%
                      <el-select v-model="Tab_jbxx_Data_dialog.chkmatchflag" placeholder="请选择" style="width:60px">
                        <el-option key="0" label="或" value="0"></el-option>
                        <el-option key="1" label="且" value="1"></el-option>
                      </el-select>数值差超出&nbsp;
                      <el-input style="width:95px" v-model="Tab_jbxx_Data_dialog.chklastabs"
                        type="number"></el-input>审核前提醒
                    </td>
                  </tr>
                  <tr>
                    <td colspan="4" style="text-align:left;">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      <el-checkbox v-model="Tab_jbxx_Data_dialog.mustmatchlastflag">结果标志和上次不同警告</el-checkbox>
                    </td>
                    <td>
                      <el-checkbox v-model="Tab_jbxx_Data_dialog.mustmatchlast">结果和上次不同警告</el-checkbox>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="4" style="text-align:left;">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      <el-checkbox v-model="Tab_jbxx_Data_dialog.forbidchk_txtresult">未列文字结果禁止审核</el-checkbox>
                    </td>
                    <!-- <td>
                                          <el-checkbox v-model="modifyallmatchflag" true-label='1' false-label="0">同时修改所有报告项目匹配标志(或者、并且)</el-checkbox>
                                      </td> -->
                  </tr>
                </table>
              </div>
            </el-tab-pane>
            <el-tab-pane label="危急值" name="anchor-3">
              <div style="width:100%" class="scroll_title">
                <table>
                  <tr>
                    <td>与上次比较危急值</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data_dialog.limit_rule" readonly placeholder="双击弹窗"
                        @dblclick.native="tab_jbxx_limitrule_dbclick();">
                      </el-input>
                    </td>
                  </tr>
                  <tr>
                    <td>危急值分类</td>
                    <td>
                      <!-- <el-input style="width:95px" v-model="Tab_jbxx_Data_dialog.alertkind"></el-input> -->
                      <el-select v-model="Tab_jbxx_Data_dialog.alertkind" style="width:95px">
                        <el-option v-for="(item, index) in $opt.alterKindOption" :key="index" :value="item.value"
                          :label="item.label"></el-option>
                      </el-select>
                    </td>
                    <td>
                      <el-checkbox v-model="Tab_jbxx_Data_dialog.autoalert">危急值自动上报</el-checkbox>
                    </td>
                  </tr>
                  <tr>
                    <td style="text-align:right;">危急值在</td>
                    <td>
                      <el-input style="width:95px" v-model="Tab_jbxx_Data_dialog.alertouthours" type="number"></el-input>
                    </td>
                    <td colspan="2">
                      小时内重复出现不再上报(0或空=总是上报，-1=本次住院)
                      <el-button size="small" @click="tab_jbxx_getouthour_event">对应申请科室</el-button>
                    </td>
                  </tr>

                </table>
              </div>
            </el-tab-pane>
            <el-tab-pane label="计算公式" name="anchor-4">
              <div style="width:100%" class="scroll_title">
                <table>
                  <tr>
                    <td colspan="8">
                      <el-checkbox v-model="Tab_jbxx_Data_dialog.iscalc">
                        <span color="#409EFF">计算公式</span>
                      </el-checkbox>
                    </td>
                  </tr>
                  <tr>
                    <td>计算公式</td>
                    <td colspan="6">
                      <el-input style="width:590px" readonly v-model="Tab_jbxx_Data_dialog.calc_formula"></el-input>
                    </td>
                    <td>
                      <el-button size="small" :disabled="!Tab_jbxx_Data_dialog.iscalc"
                        @click="jbxx_iscalc_click">公式向导</el-button>
                    </td>
                  </tr>
                  <tr>
                    <td>计算公式显示</td>
                    <td colspan="7">
                      <el-input style="width:590px" readonly=""
                        v-model="Tab_jbxx_Data_dialog.calc_formulatext"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td>结果1计算公式</td>
                    <td colspan="6">
                      <el-input style="width:590px" readonly v-model="Tab_jbxx_Data_dialog.result1formula"></el-input>

                    </td>
                    <td>
                      <el-button @click.native="opendialogresult(1)">公式向导</el-button>
                    </td>
                  </tr>
                  <tr>
                    <td>结果2计算公式</td>
                    <td colspan="6">
                      <el-input style="width:590px" readonly v-model="Tab_jbxx_Data_dialog.result2formula"></el-input>

                    </td>
                    <td>
                      <el-button @click.native="opendialogresult(2)">公式向导</el-button>
                    </td>
                  </tr>
                  <tr>
                    <td>结果3计算公式</td>
                    <td colspan="6">
                      <el-input style="width:590px" readonly v-model="Tab_jbxx_Data_dialog.result3formula"></el-input>

                    </td>
                    <td>
                      <el-button @click.native="opendialogresult(3)">公式向导</el-button>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="5">
                      <el-button @click="calchelpdoc" icon="el-icon-download">计算公式帮助文档</el-button>
                    </td>
                  </tr>
                </table>
              </div>
            </el-tab-pane>
            <el-tab-pane label="外部代码及其它" name="anchor-5">
              <div style="width:100%" class="scroll_title">
                <table>
                  <tr>
                    <td>外部代码1</td>
                    <td colspan="3">
                      <el-input @dblclick.native="jbxx_open_externalcodeDialog('e1')" placeholder="请输入或双击选择"
                        v-model="Tab_jbxx_Data_dialog.externalcode1"></el-input>
                    </td>
                    <td>外部代码4</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data_dialog.externalcode4" placeholder="请输入或双击选择"
                        @dblclick.native="jbxx_open_externalcodeDialog('e4')">
                      </el-input>
                    </td>
                  </tr>
                  <tr>
                    <td>外部代码2</td>
                    <td colspan="3">
                      <el-input @dblclick.native="jbxx_open_externalcodeDialog('e2')" placeholder="请输入或双击选择"
                        v-model="Tab_jbxx_Data_dialog.externalcode2"></el-input>
                    </td>
                    <td>外部代码5</td>
                    <td colspan="3">
                      <el-input style="width:280px" v-model="Tab_jbxx_Data_dialog.externalcode5" placeholder="请输入或双击选择"
                        @dblclick.native="jbxx_open_externalcodeDialog('e5')">
                      </el-input>
                    </td>
                  </tr>
                  <tr>
                    <td>外部代码3</td>
                    <td colspan="3">
                      <el-input @dblclick.native="jbxx_open_externalcodeDialog('e3')" placeholder="请输入或双击选择"
                        v-model="Tab_jbxx_Data_dialog.externalcode3"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="8" style="text-align:left;">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      建议：外部代码1 用作HIS系统对照，代码2 用作体检系统对照，代码3 用作rmlis4的对照
                    </td>
                  </tr>
                  <tr>
                    <td>基准代码</td>
                    <td colspan="7">
                      <el-input style="width:600px" v-model="Tab_jbxx_Data_dialog.basecode"></el-input>
                    </td>
                  </tr>
                  <tr>
                    <td style="text-align:right;">结果超出</td>
                    <td>
                      <el-input style="width:95px" v-model="Tab_jbxx_Data_dialog.dilutionlimit" type="number"></el-input>
                    </td>
                    <td colspan="2" style="text-align:left;">需稀释后测试，默认稀释倍数<el-input style="width:95px"
                        v-model="Tab_jbxx_Data_dialog.dilutionrate" type="number"></el-input>
                    </td>
                  </tr>
                </table>
              </div>
            </el-tab-pane>
          </el-tabs>
        </el-form>
      </div>
      <div style="margin-top:5px;text-align:right;margin-right:10px;">
        <el-checkbox v-model="savenotclosedialog" true-label="1" false-label="0">保存后不关闭弹窗</el-checkbox>
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
        <el-button icon="el-icon-document" @click="main_dialog_saveEvent">保存</el-button>
        <el-button icon="el-icon-close" @click="main_dialog_canelEvent">取消</el-button>
      </div>
    </el-dialog>
    <!--导出-->
    <el-dialog title="请选择要导出的格式" :visible.sync="ExportEventDiv" width="500px">
      <div style="width:100%;height:300px;border:1 px solid #CCC">
        <vxe-table :data="msgList" :show-header="true" height="auto" highlight-current-row highlight-hover-row
          @current-change="ExportChangeEvent">
          <vxe-table-column field="msg" title="导出格式" header-align="center">
            <template v-slot="{ row }">
              <div class="msg-item">{{ row.msg }}</div>
            </template>
          </vxe-table-column>
        </vxe-table>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="tab_jbxx_exportEvent">确 定</el-button>
        <el-button @click="ExportEventDiv = false">取 消</el-button>
      </span>
    </el-dialog>
    <!--结果计算公式--->
    <el-dialog title="文字结果计算公式" :visible.sync="dialogResult" width="800px" v-el-drag-dialog :append-to-body="true"
      :close-on-click-modal="false">
      <div style="width:100%;height:500px;border:1 px solid #CCC">
        <rm-layout-top splitcolor="white" :splitwidth=5 :fixsize=70 :canDrag="false">
          <template v-slot:fix>
            <el-input type="textarea" v-model="result_text" :rows="3" style="width:100%"
              id="result_calc_formula_id"></el-input>
          </template>
          <rm-layout-right splitcolor="white" movingcolor="#0000ff" :splitwidth=5 :fixsize=450 :canDrag="false">
            <template v-slot:fix>
              <div style="width:450px">
                <table>
                  <tr>
                    <td>
                      <el-button style="width:80px;margin-bottom:2px;"
                        @click="result_iscalc_addevent(' + ');">+</el-button>
                    </td>
                    <td>
                      <el-button style="width:80px;margin-bottom:2px;"
                        @click="result_iscalc_addevent(' - ');">-</el-button>
                    </td>
                    <td>
                      <el-button style="width:80px;margin-bottom:2px;"
                        @click="result_iscalc_addevent(' * ');">*</el-button>
                    </td>
                    <td>
                      <el-button style="width:80px;margin-bottom:2px;"
                        @click="result_iscalc_addevent(' / ');">/</el-button>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      <el-button style="width:80px;margin-bottom:2px;"
                        @click="result_iscalc_addevent(' ( ');">(</el-button>
                    </td>
                    <td>
                      <el-button style="width:80px;margin-bottom:2px;"
                        @click="result_iscalc_addevent(' ) ');">)</el-button>
                    </td>
                    <td>
                      <el-button style="width:80px;margin-bottom:2px;"
                        @click="result_iscalc_addevent('SEX1');">性别男</el-button>
                    </td>
                    <td>
                      <el-button style="width:80px;margin-bottom:2px;"
                        @click="result_iscalc_addevent('SEX2');">性别女</el-button>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      <el-button style="width:80px;margin-bottom:2px;"
                        @click="result_iscalc_addevent(' [AGE] ');">年龄</el-button>
                    </td>
                    <td>
                      <el-button style="width:80px;margin-bottom:2px;"
                        @click="jbxx_iscalc_specimen_dialogflag = true;">标本类型</el-button>
                    </td>
                    <td>
                      <el-button style="width:80px;margin-bottom:2px;"
                        @click="jbxx_iscalc_dept_dialogflag = true;">申请科室</el-button>
                    </td>
                    <td>
                      <el-button style="width:80px;margin-bottom:2px;"
                        @click="jbxx_iscalc_ward_dialogflag = true;">申请病区</el-button>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="3">
                    </td>
                    <td>
                      <el-button style="width:80px;margin-bottom:2px;"
                        @click="jbxx_iscalc_hospital_dialogflag = true;">送检医院</el-button>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="4">
                      <el-divider content-position="left">
                        <font color="#409EFF">说明</font>
                      </el-divider>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="4" style="text-align:left;">
                      仅支持[R]或[@R]的表达式，[R]就是当前项目的result_num，[@R]表示result_str
                    </td>
                  </tr>
                  <tr>
                    <td colspan="4">
                      <el-divider content-position="left">
                      </el-divider>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="4" style="text-align:right;">
                      <el-button @click="result_saveevent" icon="el-icon-document">确定</el-button>
                      <el-button @click="dialogResult = false" icon="el-icon-close">取消</el-button>
                    </td>
                  </tr>
                </table>
              </div>
            </template>
            <div style="height:100%;width:100%;">
              <vxe-table :data="resultData" :show-header="true" height="auto" highlight-current-row highlight-hover-row
                :select-config="{ tigger: 'cell' }" @cell-dblclick="result_iscalc_data_dbclick" border size="mini"
                show-header-overflow resizable stripe>
                <vxe-table-column type="index" title="NO." width="40" header-align="center">
                </vxe-table-column>
                <vxe-table-column field="result_num" title="数字结果(双击)" width="100" header-align="center">
                </vxe-table-column>
                <vxe-table-column field="result_str" title="文本结果(双击)" width="100" header-align="center">
                </vxe-table-column>
              </vxe-table>
            </div>
          </rm-layout-right>
        </rm-layout-top>
      </div>
    </el-dialog>
    <!--常用公式向导--->
    <el-dialog title="常用计算项目向导" :visible.sync="jbxx_iscalcGuide_dialog" width="900px" v-el-drag-dialog
      :append-to-body="true" :close-on-click-modal="false">
      <div style="height:500px" :key="CalcTestKey">
        <rm-layout-top splitcolor="white" :splitwidth=5 :fixsize=100>
          <template v-slot:fix>
            <div style="height:100px;border:1px solid #CCC" v-html="calcGuide_calcformula">
            </div>
          </template>
          <rm-layout-bottom splitcolor="white" :splitwidth=0 :canDrag=false>
            <template v-slot:fix>
              <div style="float:right">
                <table style="float:right">
                  <tr>
                    <td>
                      <el-button @click.native="ExportCalcGuide">导出CalcGuide</el-button>
                    </td>
                    <td>
                      <el-input v-model="CalcTestValue" readonly></el-input>
                    </td>
                    <td>
                      <el-button @click.native="CalcTest($event)">计算测试</el-button>
                    </td>
                    <td>
                      <el-button @click.native="SureCalcGuide">确定</el-button>
                    </td>
                    <td>
                      <el-button @click.native="jbxx_iscalcGuide_dialog = false">取消</el-button>
                    </td>
                  </tr>
                </table>
              </div>
            </template>
            <rm-layout-right splitcolor="white" movingcolor="#0000ff" :splitwidth=5 :fixsize=500>
              <template v-slot:fix>
                <div style="height:100%">
                  <vxe-table show-overflow ref="prxTable" height="auto" :select-config="{ reserve: true }"
                    :sort-config="{ trigger: 'cell' }" :mouse-config="{ selected: true }" :data.sync="Lab_CalcItemData" border
                    size="mini" show-header-overflow highlight-current-row highlight-hover-row resizable stripe
                    :edit-config="{ trigger: 'click', mode: 'cell', showStatus: true, showIcon: false }"
                    @cell-dblclick="calcGuideDblclick">
                    <vxe-table-column field="calcformulaitem" title="计算要素" width="140" sortable header-align="center"
                      :formatter="['formatSelect', calcGuideOption]"></vxe-table-column>
                    <vxe-table-column field="testvalue" title="输入测试结果" width="90" header-align="center"
                      :edit-render="{ name: 'input', autoselect: true }"></vxe-table-column>
                    <vxe-table-column field="rpt_itemname" title="报告项目名称" width="110"
                      header-align="center"></vxe-table-column>
                    <vxe-table-column field="itemcode_en" title="英文缩写" width="70"
                      header-align="center"></vxe-table-column>
                    <vxe-table-column field="unit" title="单位" width="50" header-align="center"
                      align="center"></vxe-table-column>
                    <vxe-table-column field="testmethod" title="测试方法" width="80" sortable
                      header-align="center"></vxe-table-column>
                    <vxe-table-column field="ref_text" title="参考值显示" width="80" header-align="center"></vxe-table-column>
                    <vxe-table-column field="rpt_itemcode" title="报告项目代码" width="80"
                      header-align="center"></vxe-table-column>
                  </vxe-table>
                </div>
              </template>
              <div style="height:100%;width:100%;">
                <vxe-table show-overflow ref="plxTable" height="auto" :loading="Lab_CalcGuideloading"
                  :select-config="{ reserve: true }" :sort-config="{ trigger: 'cell' }" :mouse-config="{ selected: true }"
                  :data.sync="Lab_CalcGuideData" border size="mini" show-header-overflow highlight-current-row
                  highlight-hover-row resizable stripe
                  :edit-config="{ trigger: 'click', mode: 'cell', showStatus: true, showIcon: false }"
                  @current-change="currentCalcGuideChangeEvent">
                  <vxe-table-column field="rpt_itemname" title="项目名称" width="300" sortable
                    header-align="center"></vxe-table-column>
                  <vxe-table-column field="calcformula" title="计算公式" width="200" header-align="center"></vxe-table-column>
                  <vxe-table-column field="note" title="备注说明" width="70" header-align="center"></vxe-table-column>
                  <vxe-table-column field="seq" title="序号" width="50" header-align="center"
                    align="center"></vxe-table-column>
                  <vxe-table-column field="calcguideid" title="公式ID" width="50" header-align="center"
                    align="center"></vxe-table-column>
                </vxe-table>
              </div>
            </rm-layout-right>
          </rm-layout-bottom>
        </rm-layout-top>
      </div>
    </el-dialog>
    <!--公式计算测试test--->
    <el-dialog title="公式计算测试" :visible.sync="jbxx_iscalctest_dialog" width="700px" v-el-drag-dialog :append-to-body="true"
      :close-on-click-modal="false">
      <div style="height:350px">
        <div style="font-size:800;margin:5px">表达式</div>
        <el-input v-model="calctestObj.teststr" type="textarea" :rows="5" style="font-size:14px;"></el-input>
        <div style="font-size:800;margin:5px">计算结果</div>
        <el-input v-model="calctestObj.testvalue" type="textarea" :rows="10" readonly style="font-size:14px;"></el-input>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click.native="calctestfun('calc')">计算测试</el-button>
        <el-button @click.native="calctestfun('doc')">帮助文档</el-button>
        <el-button @click.native="jbxx_iscalctest_dialog = false">取 消</el-button>
      </div>
    </el-dialog>
    <!--报告项目选择--->
    <el-dialog title="报告项目选择" :visible.sync="dialogrptitem" width="900px" v-el-drag-dialog :append-to-body="true"
      :close-on-click-modal="false">
      <div style="height:500px">
        <rm-layout-top splitcolor="white" :splitwidth=5 :fixsize=40 :canDrag="false">
          <template v-slot:fix>
            <div style="height:40px;border:1px solid #CCC;width:100%">
              <table>
                <tr>
                  <td style="width:50px">报告单元</td>
                  <td>
                    <rm-ddl-rptunit prgno="LIS110" v-model="calcguide.rptunitid" width="180px"></rm-ddl-rptunit>
                  </td>
                  <td>项目归类</td>
                  <td>
                    <rm-ddl-rptitemclass v-model="calcguide.itemclasscode" width="180px"
                      authflag="1"></rm-ddl-rptitemclass>
                  </td>
                  <td>快速查找</td>
                  <td>
                    <el-input v-model="calcguide.txtsearch" placeholder="项目代码|名称|缩写|拼音码"
                      @keyup.enter.native="calcGuideQueryRptitem"></el-input>
                  </td>
                  <td>
                    <el-button type="primary" @click.native="calcGuideQueryRptitem">查询</el-button>
                  </td>
                  <td>
                    <el-button @click.native="calcGuideSureRptitem">确定</el-button>
                  </td>
                  <td>
                    <el-button @click.native="dialogrptitem = false">取消</el-button>
                  </td>
                </tr>
              </table>
            </div>
          </template>
          <div style="height:100%;width:100%;">
            <vxe-table show-overflow ref="rptitemTable" height="auto" :select-config="{ reserve: true }"
              :sort-config="{ trigger: 'cell' }" :mouse-config="{ selected: true }" :data.sync="Lab_CalcrptItemData" border
              size="mini" :loading="Lab_CalcrptItemLoading" show-header-overflow highlight-current-row highlight-hover-row
              resizable stripe :edit-config="{ trigger: 'click', mode: 'cell', showStatus: true, showIcon: false }"
              @cell-dblclick="calcGuideSureRptitem">
              <vxe-table-column field="itemclassname" title="项目归类" width="100" sortable
                header-align="center"></vxe-table-column>
              <vxe-table-column field="rpt_itemcode" title="报告项目代码" width="100" header-align="center"></vxe-table-column>
              <vxe-table-column field="itemcode_en" title="英文缩写" width="70" header-align="center"></vxe-table-column>
              <vxe-table-column field="rpt_itemname" title="报告项目名称" width="130" header-align="center"></vxe-table-column>
              <vxe-table-column field="unit" title="单位" width="50" header-align="center"
                align="center"></vxe-table-column>
              <vxe-table-column field="testmethod" title="测试方法" width="80" sortable
                header-align="center"></vxe-table-column>
              <vxe-table-column field="ref_text" title="参考值显示" width="80" header-align="center"></vxe-table-column>
              <vxe-table-column field="instrclass" title="仪器大类" width="80" header-align="center"
                align="center"></vxe-table-column>
              <vxe-table-column field="germflag_name" title="项目类型" width="80" sortable
                header-align="center"></vxe-table-column>
              <vxe-table-column field="inputcode" title="输入码" width="80" header-align="center"></vxe-table-column>
            </vxe-table>
          </div>
        </rm-layout-top>
      </div>
    </el-dialog>
    <!--参考值显示-->
    <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" title="多行参考值显示"
      :visible.sync="reftext_dialog">
      <el-input type="textarea" :rows="10" placeholder="参考值显示" v-model="val_ref_text">
      </el-input>
      <div align="right" style="width:100%;margin-top:10px;">
        <el-button @click.native="reftext_saveevent" icon="el-icon-document">保存</el-button>
        <el-button @click.native="reftext_dialog = false" icon="el-icon-close">取消</el-button>
      </div>
    </el-dialog>
    <!--来源医院-->
    <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" title="请选择外部代码来源医院"
      :visible.sync="CopyExcode.dialogCopyExcode" width="400px">
      <div style="margin:10px 15px 10px 15px">
        <table>
          <tr>
            <td>来源医院：</td>
            <td>
              <rm-ddl-common datatype="hospital" dataname="外部代码来源医院" v-model="CopyExcode.Orihospcode"
                width="200px"></rm-ddl-common>
            </td>
          </tr>
        </table>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="CopyExcodeSave">确 定</el-button>
        <el-button @click="CopyExcode.dialogCopyExcode = false">取 消</el-button>
      </div>
    </el-dialog>
    <!--科室-->
    <!-- <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" title="请选择诊断ICD" :visible.sync="dialogdeptno">
          <rm-pop-common ref="popdept" @change="deptChange" @cancel="dialogdeptno=false;" datatype="dept"></rm-pop-common>
      </el-dialog> -->

    <!--报告项目多选弹窗--->
    <!-- <el-dialog v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false" :visible.sync="dialogRptVisible" :destroy-on-close="true" title="报告项目" v-if="dialogRptVisible" @close="this.linkshow = true,$refs.xTableResult.setActiveCell($refs.xTableResult.getCurrentRow(), 'rpt_itemname')">
          <rm-chkboxSelect2 prgno="LIS310" @cancel="dialogRptVisible=false,linkshow = true,$refs.xTableResult.setActiveCell($refs.xTableResult.getCurrentRow(), 'rpt_itemname')" :isAllRpt="1" :rptunitid="rptunitid" :rptunitdisabled="true" @selitem="addrptitem" @selitems="SelectRptItems" ref="rptdialog"></rm-chkboxSelect2>
      </el-dialog> -->
    <!-- 报告项目基本信息导入选择 -->
    <el-dialog title="请选择项目导入模式" :visible.sync="importRptitemDialog" width="500px">
      <div class="importrpt-model">
        <div style="height: 100%;">
          <vxe-table ref="rptmodelTable" :data.sync="importrptmodelList" class="mytable-style" height="auto" resizable
            stripe :keyboard-local-config="keyLocalConfig" border size="mini" highlight-current-row :show-header="false"
            @cell-dblclick="chooseRptmodel">
            <vxe-table-column field="name" title=" " width="400"></vxe-table-column>
          </vxe-table>
        </div>
        <div class="importrpt-modelbtn">
          <div>
            <el-button @click="chooseRptmodel">确定</el-button>
          </div>
          <div>
            <el-button @click="importRptitemDialog = false;">取消</el-button>
          </div>
        </div>
      </div>
    </el-dialog>
    <!-- 报告项目基本信息导入 -->
    <el-dialog title="LIS110 报告项目" :visible.sync="exeimportRptDialog" v-if="exeimportRptDialog" width="800px"
      :before-close="clearImportdata">
      <div>
        <div style="height: 500px;">
          <vxe-table ref="importrptTable" :data.sync="importrptList" class="mytable-style" height="auto" resizable stripe
            border size="mini" highlight-current-row header-align="center">
            <vxe-table-column field="itemclasscode" sortable title="项目归类" width="70" show-overflow></vxe-table-column>
            <vxe-table-column field="rpt_itemname" sortable title="报告项目名称" width="120" show-overflow></vxe-table-column>
            <vxe-table-column field="rpt_itemcode" sortable title="报告项目代码" width="90" show-overflow></vxe-table-column>
            <vxe-table-column field="germflag_name" sortable title="项目类型" width="70" show-overflow></vxe-table-column>
            <vxe-table-column field="instrclass" sortable title="仪器大类" width="70" show-overflow></vxe-table-column>
            <vxe-table-column field="itemcode_en" sortable title="英文缩写" width="58" show-overflow></vxe-table-column>
            <vxe-table-column field="itemname_en" sortable title="英文名称" width="70" show-overflow></vxe-table-column>
            <vxe-table-column field="resulttype_name" sortable title="结果类型" width="78" show-overflow></vxe-table-column>
            <vxe-table-column field="textresultflag_name" sortable title="默认文字结果标志" width="130"
              show-overflow></vxe-table-column>
            <vxe-table-column field="unit" sortable title="单位" width="50" show-overflow></vxe-table-column>
            <vxe-table-column field="dec_digits_name" sortable title="小数位数" width="70" show-overflow></vxe-table-column>
            <vxe-table-column field="rptcode" sortable title="报告单代码" width="80" show-overflow></vxe-table-column>
            <vxe-table-column field="ref_l" sortable title="参考低值" width="70" show-overflow></vxe-table-column>
            <vxe-table-column field="ref_h" sortable title="参考高值" width="70" show-overflow></vxe-table-column>
            <vxe-table-column field="ref_text" sortable title="参考值显示" width="80" show-overflow></vxe-table-column>
          </vxe-table>
        </div>
        <div style="margin-top: 10px;">
          <el-button @click="deleteRptrow">删除</el-button>
          <el-button @click="cancelDatachange">取消</el-button>
          <el-button @click="saveRptimport">保存</el-button>
          <el-button @click="clearImportdata">退出</el-button>
          <span v-if="importNumtext" style="margin-left: 20px;color: blue;">{{ importNumtext }}</span>
        </div>
      </div>
    </el-dialog>
    <!-- 细菌项目导入并匹配 -->
    <el-dialog v-el-drag-dialog title="细菌项目导入并匹配" :visible.sync="exeimportMatchRptDialog" v-if="exeimportMatchRptDialog"
      width="80%" :before-close="clearImportMatchdata">
      <div>
        <div style=" height:35px;">
          <table>
            <tr>
              <td>新增数据项目归类</td>
              <td>
                <rm-ddl-rptitemclass @change="importrptitemclassChange" v-model="import_itemclasscode" authflag="1"
                  width="210px"></rm-ddl-rptitemclass>
              </td>
              <td>新增数据仪器大类</td>
              <td>
                <rm-ddl-common @change="importinstrclassChange" datatype="seccode" kindno="INSTRCLASS"
                  v-model="import_instrclass" width="200px"></rm-ddl-common>
              </td>
              <td>
                <el-checkbox v-model="CHNMatchCoverEN" true-label="1" false-label="0" @change="changeupdatetype">
                  中文名称匹配覆盖原有英文名称
                </el-checkbox>
              </td>
              <td>
                <el-checkbox v-model="ENMatchCoverCHN" true-label="1" false-label="0" @change="changeupdatetype">
                  英文名称匹配覆盖原有中文名称
                </el-checkbox>
              </td>
              <td>
                <el-checkbox v-model="showonlyupdate" true-label="1" false-label="0" @change="changeonlyshowupdate">
                  仅显示需要更新的记录
                </el-checkbox>
              </td>
            </tr>
          </table>
        </div>
        <div style="height: 400px;">
          <vxe-table ref="importMatchrptTable" :data.sync="importMatchrptList" class="mytable-style" height="auto"
            resizable stripe border size="mini" highlight-current-row header-align="center">
            <vxe-table-column field="importitemcode" sortable title="导入细菌代码" width="100" show-overflow></vxe-table-column>
            <vxe-table-column field="importitemname" sortable title="导入细菌中文名称" width="120"
              show-overflow></vxe-table-column>
            <vxe-table-column field="presentitemname" sortable title="当前库细菌中文名称" width="120"
              show-overflow></vxe-table-column>
            <vxe-table-column field="importitemname_en" sortable title="导入英文名称" width="100"
              show-overflow></vxe-table-column>
            <vxe-table-column field="presentitemname_en" sortable title="当前库细菌英文名称" width="120"
              show-overflow></vxe-table-column>
            <vxe-table-column field="matchitemcode" sortable title="匹配后细菌代码" width="120" show-overflow></vxe-table-column>
            <vxe-table-column field="updatetype" sortable title="更新模式" width="100" show-overflow></vxe-table-column>
            <vxe-table-column field="importgermgram" sortable title="革兰氏性质" width="70" show-overflow></vxe-table-column>
            <vxe-table-column field="importgermflagname" sortable title="分类" width="70" show-overflow></vxe-table-column>
            <vxe-table-column field="importgroupitemname" sortable title="菌属" width="70" show-overflow></vxe-table-column>
            <vxe-table-column field="importisgermgroup" sortable title="菌属标志" width="70" show-overflow></vxe-table-column>
            <vxe-table-column field="importwhonetcode" sortable title="WHONET代码" width="100"
              show-overflow></vxe-table-column>
            <vxe-table-column field="importitemclassname" sortable title="项目归类" width="100"
              show-overflow></vxe-table-column>
            <vxe-table-column field="importinstrclassname" sortable title="仪器大类" width="70"
              show-overflow></vxe-table-column>
          </vxe-table>
        </div>
        <div style="height: 400px;">
          <vxe-table ref="MatchrptTable" :data.sync="MatchrptList" class="mytable-style" height="auto" resizable stripe
            border size="mini" highlight-current-row header-align="center">
            <vxe-table-column field="germflag_name" sortable title="细菌标志" width="120" show-overflow></vxe-table-column>
            <vxe-table-column field="itemcode_en" sortable title="英文缩写" width="120" show-overflow></vxe-table-column>
            <vxe-table-column field="rpt_itemname" sortable title="报告项目名称" width="120" show-overflow></vxe-table-column>
            <vxe-table-column field="itemname_en" sortable title="英文名称" width="70" show-overflow></vxe-table-column>
            <vxe-table-column field="rpt_itemcode" sortable title="报告项目代码" width="120" show-overflow></vxe-table-column>
            <vxe-table-column field="itemclassname" sortable title="项目归类" width="120" show-overflow></vxe-table-column>
            <vxe-table-column field="rptcode" sortable title="报告单代码" width="100" show-overflow></vxe-table-column>
            <vxe-table-column field="itemtips" sortable title="项目备注" width="130" show-overflow></vxe-table-column>
            <vxe-table-column field="inputcode" sortable title="输入码" width="70" show-overflow></vxe-table-column>
          </vxe-table>
        </div>
        <div style="margin-top: 10px;">
          <el-button @click="btnimportMatch">导入</el-button>
          <el-button @click="saveRptimportMatch">确定</el-button>
          <el-button @click="clearImportMatchdata">退出</el-button>
          <span v-if="importNumtext" style="margin-left: 20px;color: blue;">{{ importNumtext }}</span>
          <div class="upload-button">
            <el-upload ref="uploadmatch" :action="url" accept=".xlsx" :on-change="fileChange" :show-file-list="showFile"
              :data="upmatchdata" :http-request="uploadMatchOpt">
              <el-button size="small" plain>选择文件</el-button>
              <!-- <div slot="tip" class="el-upload__tip">只能上传DAT(*dat)文件，且不超过10M</div> -->
            </el-upload>
          </div>
        </div>
      </div>
    </el-dialog>

    <el-dialog width="800px" :append-to-body="true" :close-on-click-modal="false" title="文字编辑"
      :visible.sync="uploadpasswordVisible" v-if="uploadpasswordVisible">
      <div style="font-size:12px;padding: 0 0 0 5px; text-align: right;">
        <el-radio-group v-model="isoverride" style="margin-right: 5px;">
          <el-radio :label="0" selected size="mini">直接覆盖原来所有的报告项目(效率较低)</el-radio>
          <el-radio :label="1" size="mini">不覆盖，全部删除后再导入</el-radio>
        </el-radio-group>
        <el-button @click="uploadpasswordSure()">确定</el-button>
        <el-button @click="uploadpasswordVisible = false;">取消</el-button>
      </div>
      <div style="margin-top: 5px;height: 50px;">
        <el-input ref="uploadpasswordinput" placeholder="请输入'导入'两字" v-model="uploadpassword"
          style="height: 50px;"></el-input>
      </div>
    </el-dialog>
    <el-dialog title="文件导入提示" :visible.sync="fileimportnotifyVisible" width="30%">
      <el-form :model="fileimportform">
        <el-form-item label="上传文件" :label-width="formLabelWidth">
          <el-upload ref="uploadDat" action="" :limit=limitNum :auto-upload="false" accept=".dat"
            :before-upload="beforeUploadFile" :on-change="fileimportChange" :on-exceed="exceedFile" :file-list="fileList">
            <el-button size="small" plain>选择文件</el-button>
            <div slot="tip" class="el-upload__tip">只能上传DAT(*dat)文件，且不超过10M。</div>
          </el-upload>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <!-- <template>
                  <div style="font-size:12px;float:top;padding-top:3px;background-color:#fff;">
                      <el-progress :text-inside="true" :stroke-width="15" :percentage=percentage status="success"></el-progress>
                  </div>
                  <div style="clear:both"></div>
              </template> -->
        <el-button size="small" type="primary" @click="uploadFile()">立即上传</el-button>
        <el-button @click="fileimportnotifyVisible = false">取 消</el-button>
      </span>
    </el-dialog>
    <el-dialog width="1000px" top="10px" v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false"
      :visible.sync="req_itemdialog" :destroy-on-close="true" title="申请项目">
      <rm-pop-common datatype="reqitem" dataname="申请项目" :filterable="true" size="mini" width="100%" :clearable="true"
        :appendtobody="true" key="dialogreq_itemcode" @change="req_itemchange"
        @cancel="reqouterVisible = false"></rm-pop-common>
    </el-dialog>
  </div>
</template>


<script>
import { Promise } from "q";
import { invalid } from "moment";
import XE from "xe-utils"; //引入工具类
import XLSX from "xlsx";
import FileSaver from "file-saver";
import axios from "axios";
XE.mixin({
  // 自定义全局的格式化处理函数
  formatSelect(cellValue, list) {
    let item = list.find((item) => item.value == cellValue);
    return item ? item.label : cellValue;
  },
});
import RmRptitemref from "@/components/rmcompents/rmlis/RmRptitemref.vue";
import XEUtils from "xe-utils";
export default {
  name: "LIS110",
  components: {
    RmRptitemref,
  },
  data() {
    return {
      resultkindOption: [
        { label: "默认", value: "0" },
        { label: "结果1", value: "1" },
        { label: "结果2", value: "2" },
        { label: "结果3", value: "3" },
        { label: "结果4", value: "4" },
        { label: "结果5", value: "5" },
        { label: "结果6", value: "6" },
        { label: "大文本结果", value: "7" },
      ],
      result_flagOption: [
        { label: "", value: "" },
        { label: "正常[M]", value: "M" },
        { label: "偏高[H]", value: "H" },
        { label: "偏低[L]", value: "L" },
        { label: "阳性[P]", value: "P" },
        { label: "弱阳性[Q]", value: "Q" },
        { label: "错误[E]", value: "E" },
        { label: "阴性[N]", value: "N" },
      ],
      patSexOption: [
        { label: "男", value: "1" },
        { label: "女", value: "2" },
        { label: "无关", value: "All" },
      ],
      resTypeOption: [
        { label: "数值型", value: "1" },
        { label: "文字型", value: "2" },
        { label: "阴阳性", value: "3" },
        { label: "数字文字混合", value: "4" },
      ],

      diff_signOption: [
        { label: "增高", value: "1" },
        { label: "变化", value: "0" },
        { label: "降低", value: "-1" },
      ],
      calcGuideOption: [
        {
          label: "年龄",
          value: "AGE",
        },
        {
          label: "性别",
          value: "SEX",
        },
      ],
      anchor: "anchor-0",
      buttonwidth: "",
      search_itemclasscode: "",
      search_rptunitid: "",
      search_rptunitname: "",
      seach_germflag: "",
      seach_instrclass: "",
      seach_keystr: "",
      seach_stopflag: 0,
      MainTableData: [],
      tableColumn: [],
      MainLoading: false,
      Tab_ckzmx_style: false,
      Tab_jbxx_Data_dialog: {},
      Tab_jbxx_Data: {},
      main_dialogflag: false,
      main_dialog_name: "",
      tab_jbxx_outhoursdata: [],
      tab_ckzmx_loading: false,
      tab_ckzmx_data: [],
      keys: { ckzmxkey: 0, syqkkey: 0 },
      tab_wzjg_loading: false,
      tab_wzjg_data: [],
      tab_ybzh_loading: false,
      tab_ybzh_data: [],
      tab_syqk_loading: false,
      tab_syqk_data: [],
      tab_syqk_ckzmx_loading: false,
      tab_syqk_ckzmx_data: [],
      tab_pcxm_loading: false,
      tab_pcxm_data: [],
      tab_glxm_loading: false,
      tab_glxm_data: [],
      tab_sqxm_loading: false,
      tab_sqxm_data: [],
      tab_showflag: "tabname_jbxx",
      jbxx_rptitemcode_readonly: false,
      jbxx_seq_readonly: true,
      jbxx_reftext_dialogflag: false,
      jbxx_outhours_dialogflag: false,
      jbxx_limitrules_dialogflag: false,
      jbxx_limitrules_dialogflag_hours: "",
      jbxx_limitrules_dialogflag_change: "",
      jbxx_limitrules_dialogflag_cg: "",
      jbxx_limitrules_dialogflag_percent: "",
      jbxx_iscalc_dialogflag: false,
      jbxx_iscalc_loading: false,
      jbxx_iscalc_data: [],
      jbxx_iscalc_dataOri: [],
      jbxx_iscalc_seach: "",
      jbxx_iscalc_specimen_dialogflag: false,
      jbxx_iscalc_dept_dialogflag: false,
      jbxx_iscalc_ward_dialogflag: false,
      jbxx_iscalc_hospital_dialogflag: false,
      jbxx_s_calc_formula: "",
      jbxx_s_calc_formulatext: "",
      jbxx_iscalcGuide_dialog: false, //常用公式向导
      CalcTestKey: 0,
      CalcTestValue: 0,
      calcGuide_calcformula: "",
      calcguide: {},
      dialogrptitem: false, //常用公式报告项目开窗
      jbxx_externalcode_tableData: [], //界面展示数据
      jbxx_externalcode_tableDataLog: [], //AJAX真实获取数据
      jbxx_externalcode_seach: "", //外部代码查询条件
      jbxx_dialogTable_externalcode: false, //外部代码弹出框控制标志
      jbxx_externalcode_flag: "", //打开外部代码弹出框 记录外部代码 1/2/3

      tab_jbxx_button: "inline",
      tab_ckzmx_button: "none",
      tab_wzjg_button: "none",
      tab_lcyy_button: "none",
      tab_ybzh_button: "none",
      tab_syqk_button: "none",
      tab_pcxm_button: "none",
      tab_glxm_button: "none",
      tab_czjc_button: "none",
      tab_sqxm_button: "none",
      // tab_ckzmx_validRules: {
      //     rptunitid: [{ required: true, message: "必须填写" }],
      //     patsex: [{ required: true, message: "必须填写性别" }],
      //     ageyear1: [{ required: true, message: "必须填写年龄1" }],
      //     ageyear2: [{ required: true, message: "必须填写年龄2" }],
      //     specimen_code: [{ required: true, message: "必须填写标本类型" }],
      //     physicycle: [{ required: true, message: "必须填写生理周期" }],
      //     diag_icd: [{ required: true, message: "必须填写诊断ICD编码" }],
      //     deptno: [{ required: true, message: "必须填写科室" }],
      // },
      tab_ybzh_validRules: {
        specimencode: [{ required: true, message: "必须填写" }],
        destrptitemcode: [{ required: true, message: "必须填写" }],
      },
      tab_jbxx_outhours_validRules: {
        req_deptno: [{ required: true, message: "必须填写" }],
        alertouthours: [{ required: true, message: "必须填写" }],
      },
      tab_pcxm_validRules: {
        mutex_rptitemcode: [{ required: true, message: "必须填写" }],
        seq: [{ required: true, message: "必须填写" }],
      },
      tab_glxm_validRules: {
        link_rptitemcode: [{ required: true, message: "必须填写" }],
        seq: [{ required: true, message: "必须填写" }],
      },
      tab_wzjg_validRules: {
        textvalue: [{ required: true, message: "必须填写文字结果" }],
      },
      tab_ckzmx_bysex_if: false,
      tab_ckzmx_byage_if: false,
      tab_ckzmx_byspecimen_if: false,
      tab_ckzmx_byphysicycle_if: false,
      tab_ckzmx_bydiag_if: false,
      tab_ckzmx_bydept_if: false,
      tab_syqk_data_rptunitid: "",
      tab_unitList: [],
      tab_label: "基本信息",
      tab_czjc_loading: false,
      tab_czjc_data: [],
      tab_czjc_validRules: {
        rpt_itemcode: [{ required: true, message: "必须填写报告项目代码" }],
        seq: [{ required: true, message: "必须填写序号" }],
        lastdays_min: [{ required: true, message: "必须填写结果相差天数1" }],
        lastdays_max: [{ required: true, message: "必须填写结果相差天数2" }],
        result_min: [{ required: true, message: "必须填写结果段起始值" }],
        result_max: [{ required: true, message: "必须填写结果段结束值" }],
        diff_sign: [{ required: true, message: "必须选择变动方向" }],
        diff_abs: [{ required: true, message: "必须填写变动绝对值" }],
        diff_per: [{ required: true, message: "必须填写变动百分比" }],
      },
      tab_sqxm_validRules: {},
      pageinitloading: false,
      ModData: [],
      AddData: [],
      selrow: [],
      ExportEventDiv: false,
      exportid: "",
      ResSql: "",
      msgList: [
        { msg: "1.导出Excel文件（当前列表项目15列信息，可导入）", value: "1" },
        { msg: "2.导出列表信息", value: "2" },
        { msg: "3.导出Xml文件（当前列表项目所有信息）", value: "3" },
        { msg: "4.dat文件（当前数据库所有项目所有信息）", value: "4" },
      ],
      keyConfig: {
        isDel: true,
        isTab: true,
        isEdit: true,
        isArrow: true,
      },
      physicycleOption: [],
      specimenOption: [],
      reskey: 0,
      jbxx_ref_text: "",
      main_dialogkey: 0,
      savenotclosedialog: "0",
      headtitle: "",
      dialogResult: false,
      resultData: [],
      result_text: "",
      resultflag: "1",
      tab_pcxmrow: {},
      tab_glxmrow: {},
      Lab_CalcGuideData: [], //常用计算公式
      Lab_CalcGuideloading: false,
      Lab_CalcItemData: [],
      Lab_CalcrptItemData: [], //报告项目
      Lab_CalcrptItemLoading: false,
      calcGuideRptitemRow: {},
      verifyStr: "",
      diagicdOption: [],
      // dialogdiagicd: false,
      diag_icd_reftextRow: {}, //ICD编码
      disabledKindGroup: true,
      reftext_dialog: false, //多行参考值弹窗
      val_ref_text: "",
      jbxx_iscalctest_dialog: false, //常用公式计算测试
      calctestObj: { teststr: "", testvalue: "" }, //计算测试涉及字段
      //dialogdeptno: false,
      deptOption: [],
      isbis: false,
      toolbarspan: 10,
      topheight: 100,
      related: {},
      importRptitemDialog: false,
      importrptmodelList: [
        { name: "1、导入Excel，用于补充项目", value: "1" },
        { name: "2、导入细菌字典用于补充和智能匹配", value: "2" },
        { name: "3、导入dat文件替换当前所有项目", value: "3" },
      ],
      keyLocalConfig: {
        isArrow: true,
      },
      exeimportRptDialog: false,
      exeimportMatchRptDialog: false,
      fimportrptList: [],
      importrptList: [],
      importMatchrptList: [],
      MatchrptList: [],
      form: {},
      showFile: false,
      url: "",
      updata: { action: "LIS110-excel" },
      upmatchdata: { action: "LIS110-excelmatch" },
      importNumtext: "",
      IsAreaMode: false,
      CopyExcode: {
        dialogCopyExcode: false,
        Orihospcode: "",
      },
      isoverride: 0,
      uploadpassword: "", //项目导入口令
      uploadpasswordVisible: false, //项目导入口令确认弹窗
      limitNum: 1,
      formLabelWidth: "100px",
      fileimportform: {
        file: "",
      },
      fileList: [],
      fileimportnotifyVisible: false,
      //percentage: 0, //进度条
      oldcompitemcode: "",
      refvaljoinchar: "--",
      req_itemdialog: false,
      tableCopyData: [],
      refvaldigitsmatch: "",
      CHNMatchCoverEN: "1",
      ENMatchCoverCHN: "1",
      import_itemclasscode: "",
      import_instrclass: "",
      showonlyupdate: "0",
      haswzjg: "0", //是否有文字结果
      wzjgOption: [], //文字结果选项
      // modifyallmatchflag: "0",
    };
  },
  created() {
    this.isbis = this.$tool.checkBis();
    if (this.isbis) {
      this.toolbarspan = 7;
      this.topheight = 66;
    }
    this.getButtonWidth();
    this.MainTable_Rfresh();
    this.rexternalcode_refresh();
    this.getUnitList();
    this.$ddldata.IsAreaModeFun().then((res) => {
      this.IsAreaMode = res;
    }); //防止刷新页面导致IsAreaMode被清掉
  },
  mounted() {
    this.url = this.$tool.baseUrl.replace("api", "z") + "fileupload";
  },
  destroyed() { },
  updated() {
    this.getButtonWidth();
  },
  methods: {
    getButtonWidth() {
      if (this.$refs.buttondiv) {
        this.buttonwidth = this.$refs.buttondiv.parentElement.parentElement.parentElement.parentElement.offsetWidth - 200 + "px";
      }
    },
    getUnitList() {
      this.$tool
        .request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "lab_getUnit",
          },
        })
        .then((res) => {
          this.tab_unitList = res.list1;
          this.physicycleOption = res.list2;
          this.specimenOption = res.list3;
          this.diagicdOption = res.list4;
          this.deptOption = res.list5;
          if (res.refvaljoinchar != "") this.refvaljoinchar = res.refvaljoinchar;
          this.refvaldigitsmatch = res.refvaldigitsmatch;
          //报告项目维护及报告单元对照报告项目参考值显示的小数点位数，默认自动匹配于报告项目维护里维护的小数位数
        })
        .catch((e) => {
          this.$message.error(e);
        });
    },
    btnCopyExcode() {
      this.CopyExcode.dialogCopyExcode = true;
      this.CopyExcode.Orihospcode = "";
    },
    //主表查询
    async MainTable_Rfresh() {
      this.MainLoading = true;
      try {
        const res = await this.$tool.request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "lab_rptitem_query",
            itemclasscode: this.search_itemclasscode,
            rptunitid: this.search_rptunitid,
            germflag: this.seach_germflag,
            instrclass: this.seach_instrclass,
            keystr: this.seach_keystr,
            stopflag: this.seach_stopflag,
          },
        });
        this.MainTableData = res.RData.Data;
        this.tableColumn = res.RData.Cols;
        this.ResSql = res.ResSql;
        if (res.RData.Data.length > 0) {
          this.Tab_jbxx_Data.rpt_itemcode = res.RData.Data[0].rpt_itemcode;
          this.selrow = res.RData.Data[0];
          this.$refs.Main_Table.setCurrentRow(res.RData.Data[0]);
          this.tabclickQuery();
        } else {
          await this.clearjbxx();
        }
        this.MainLoading = false;
      } catch (e) {
        this.$message.error(e);
        this.MainLoading = false;
      }
    },
    async clearjbxx() {
      this.selrow.rpt_itemcode = "";
      this.Tab_jbxx_Data = {};
      this.tab_wzjg_data = [];
      this.tab_ckzmx_data = [];
      this.tab_ybzh_data = [];
      this.tab_syqk_data = [];
      this.tab_syqk_ckzmx_data = [];
      this.tab_pcxm_data = [];
      this.tab_glxm_data = [];
      this.keys.ckzmxkey++;
    },
    //获取行数据
    async MainTableChange_Event({ row, rowIndex, column, columnIndex }, event) {
      this.Tab_jbxx_Data.rpt_itemcode = row.rpt_itemcode;
      this.selrow = row;
      this.relatedIsEditStat(); //换行应该改变相关字段的可编辑状态
      this.tabclickQuery();
    },
    //tab页面
    tab_getdata(tab, event) {
      // this.before_getdata()
      // this.tab_label = tab.label;
      // this.init_tabbutton();
      // this.tabclickQuery();
      // this.ckzmxkey++;
      this.before_getdata().finally(() => {
        this.tab_label = tab.label;
        this.init_tabbutton();
        this.tabclickQuery();
        this.ckzmxkey++;
      });
    },
    async before_getdata() {
      if (this.tab_label == "互斥项目") {
        this.tab_pcxm_save();
      } else if (this.tab_label == "关联项目") {
        this.tab_glxm_save();
      }
    },
    tabclickQuery() {
      if (this.tab_label == "基本信息") {
        this.tab_jbxx_button = "inline";
        this.MainTable_GetDataInfo(this.selrow.rpt_itemcode);
      } else if (this.tab_label == "参考值明细") {
        if (this.Tab_ckzmx_style) {
          this.tab_ckzmx_button = "inline";
          this.tab_ckzmx_getData();
        } else {
          this.tab_showflag = "tabname_jbxx";
          this.tab_label = "基本信息";
          this.tab_jbxx_button = "inline";
          this.MainTable_GetDataInfo(this.selrow.rpt_itemcode);
        }
      } else if (this.tab_label == "文字结果") {
        this.tab_wzjg_button = "inline";
        this.tab_wzjg_getData();
      } else if (this.tab_label == "临床意义") {
        this.tab_lcyy_button = "inline";
        this.MainTable_GetDataInfo(this.selrow.rpt_itemcode);
      } else if (this.tab_label == "样本转换") {
        this.tab_ybzh_button = "inline";
        this.tab_ybzh_getData();
      } else if (this.tab_label == "使用情况") {
        this.tab_syqk_button = "inline";
        this.tab_syqk_getData();
      } else if (this.tab_label == "互斥项目") {
        this.tab_pcxm_button = "inline";
        this.tab_pcxm_getData();
      } else if (this.tab_label == "关联项目") {
        this.tab_glxm_button = "inline";
        this.tab_glxm_getData();
      } else if (this.tab_label == "差值检查") {
        this.tab_czjc_button = "inline";
        this.tab_czjc_getData();
      } else if (this.tab_label == "申请项目") {
        this.tab_sqxm_button = "inline";
        this.tab_sqxm_getData();
      }
    },
    rptitemclassChange(code, name) {
      this.search_itemclasscode = code;
      this.MainTable_Rfresh();
    },
    rptunitChange(code, name) {
      this.search_rptunitid = code;
      this.search_rptunitname = name;
      this.MainTable_Rfresh();
    },
    germflagChange(code, name) {
      this.seach_germflag = code;
      this.MainTable_Rfresh();
    },
    instrclassChange(code, name) {
      this.seach_instrclass = code;
      this.MainTable_Rfresh();
    },
    async MainTable_GetDataInfo(rpt_itemcode) {
      //   this.init_tabbutton();
      //返回基本信息
      if (!rpt_itemcode) {
        return false;
      }
      this.pageinitloading = true;
      if (this.tab_label == "基本信息") {
        this.tab_showflag = "tabname_jbxx";
        this.tab_jbxx_button = "inline";
      }
      if (this.tab_label == "临床意义") {
        this.tab_showflag = "tabname_lcyy";
        this.tab_lcyy_button = "inline";
      }
      try {
        const res = await this.$tool.request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "lab_rptitem_query_byitemcode",
            rpt_itemcode: rpt_itemcode,
          },
        });
        res.Data[0].ref_byage = res.Data[0].ref_byage == "1" ? true : false;
        res.Data[0].ref_bysex = res.Data[0].ref_bysex == "1" ? true : false;
        res.Data[0].ref_byspecimen = res.Data[0].ref_byspecimen == "1" ? true : false;
        res.Data[0].iscalc = res.Data[0].iscalc == "1" ? true : false;
        res.Data[0].isgermgroup = res.Data[0].isgermgroup == "1" ? true : false;
        res.Data[0].mustmatchlast = res.Data[0].mustmatchlast == "1" ? true : false;
        res.Data[0].mustmatchlastflag = res.Data[0].mustmatchlastflag == "1" ? true : false;
        res.Data[0].autoalert = res.Data[0].autoalert == "1" ? true : false;
        res.Data[0].autochkflag = res.Data[0].autochkflag == "1" ? true : false;
        res.Data[0].autochk_txtresult = res.Data[0].autochk_txtresult == "1" ? true : false;
        res.Data[0].forbidchk_txtresult = res.Data[0].forbidchk_txtresult == "1" ? true : false;
        res.Data[0].autochk_qtlt = res.Data[0].autochk_qtlt == "1" ? true : false;
        res.Data[0].stopflag = res.Data[0].stopflag == "1" ? true : false;
        res.Data[0].nostat = res.Data[0].nostat == "1" ? true : false;
        res.Data[0].resulttwice = res.Data[0].resulttwice == "1" ? true : false;
        res.Data[0].shareflag = res.Data[0].shareflag; // == "1"? true : false;
        res.Data[0].sameflagautochkok = res.Data[0].sameflagautochkok == "1" ? true : false;
        this.Tab_jbxx_Data = res.Data[0];
        // console.log("sss", this.Tab_jbxx_Data);
        //判断是否显示参考值明细
        this.relatedIsEditStat();
        if (this.Tab_jbxx_Data.isgermgroup != "1") {
          //判断是不是菌属控制一级分类和二级分类是不是可以选择
          this.disabledKindGroup = true;
        } else {
          this.disabledKindGroup = false;
        }
        this.pageinitloading = false;
      } catch (e) {
        this.$message.error(e);
      }
    },
    relatedIsEditStat() {
      //判断是否显示参考值明细
      let arr = ["ref_byage", "ref_bysex", "ref_byspecimen", "ref_byphysicycle", "ref_bydiag", "ref_bydept"];
      let showrefvalflag = false;
      for (let index = 0; index < arr.length; index++) {
        const element = arr[index];
        if (!!element) {
          if (this.selrow[element] == "1") showrefvalflag = true;
        }
      }
      if (!showrefvalflag) {
        this.Tab_ckzmx_style = false;
        this.tabkey++;
      } else {
        this.Tab_ckzmx_style = true;
      }
      if (this.selrow.ref_bysex != "1") {
        this.tab_ckzmx_bysex_if = false;
      } else {
        this.tab_ckzmx_bysex_if = true;
      }
      if (this.selrow.ref_byage != "1") {
        this.tab_ckzmx_byage_if = false;
      } else {
        this.tab_ckzmx_byage_if = true;
      }
      if (this.selrow.ref_byspecimen != "1") {
        this.tab_ckzmx_byspecimen_if = false;
      } else {
        this.tab_ckzmx_byspecimen_if = true;
      }
      if (this.selrow.ref_byphysicycle != "1") {
        this.tab_ckzmx_byphysicycle_if = false;
      } else {
        this.tab_ckzmx_byphysicycle_if = true;
      }
      if (this.selrow.ref_bydiag != "1") {
        this.tab_ckzmx_bydiag_if = false;
      } else {
        this.tab_ckzmx_bydiag_if = true;
      }
      if (this.selrow.ref_bydept != "1") {
        this.tab_ckzmx_bydept_if = false;
      } else {
        this.tab_ckzmx_bydept_if = true;
      }
      //console.log("selrow", this.selrow);
      this.related = { sexrelated: this.tab_ckzmx_bysex_if, agerelated: this.tab_ckzmx_byage_if, specimenrelated: this.tab_ckzmx_byspecimen_if, physicyclerelated: this.tab_ckzmx_byphysicycle_if, diagicdrelated: this.tab_ckzmx_bydiag_if, deptrelated: this.tab_ckzmx_bydept_if };
    },
    //externalcode_refresh 数据获取/刷新方法
    rexternalcode_refresh() {
      this.$tool
        .request({
          url: "LIS/LIS1/LIS113",
          method: "post",
          data: {
            action: "get_externalmode",
          },
        })
        .then((res) => {
          this.jbxx_externalcode_tableDataLog = res.Data;
          this.jbxx_externalcode_tableData = JSON.parse(JSON.stringify(res.Data[0]));
        })
        .catch((e) => {
          this.$message.error(e);
        });
    },
    //获取拼音码
    getInputCode(event) {
      let rowinputcode = "";
      let getpinyin = this.$pinyin(event, {
        style: this.$pinyin.STYLE_FIRST_LETTER, // 首字母
        heteronym: true,
      });
      for (var i = 0; i < getpinyin.length; i++) {
        var curchar = getpinyin[i];
        if (curchar.length > 1) {
          rowinputcode += curchar[0];
        } else {
          rowinputcode += curchar;
        }
      }
      this.Tab_jbxx_Data_dialog.inputcode = rowinputcode.toUpperCase();
    },
    //弹出外部代码框
    jbxx_open_externalcodeDialog(flag) {
      this.jbxx_dialogTable_externalcode = true;
      this.jbxx_externalcode_seach = "";
      this.jbxx_externalcode_flag = flag;
      this.jbxx_externalcode_tableData.splice(0, this.jbxx_externalcode_tableData.length);
      if (flag === "e1") {
        this.jbxx_externalcode_tableData = JSON.parse(JSON.stringify(this.jbxx_externalcode_tableDataLog[0]));
      }
      if (flag === "e2") {
        this.jbxx_externalcode_tableData = JSON.parse(JSON.stringify(this.jbxx_externalcode_tableDataLog[1]));
      }
      if (flag === "e3") {
        this.jbxx_externalcode_tableData = JSON.parse(JSON.stringify(this.jbxx_externalcode_tableDataLog[2]));
      }
      if (flag === "e4") {
        this.jbxx_externalcode_tableData = JSON.parse(JSON.stringify(this.jbxx_externalcode_tableDataLog[3]));
      }
      if (flag === "e5") {
        this.jbxx_externalcode_tableData = JSON.parse(JSON.stringify(this.jbxx_externalcode_tableDataLog[4]));
      }
    },
    //外部代码 双击选择 赋值事件
    jbxx_externalcode_dbclick(evt) {
      if (this.jbxx_externalcode_flag === "e1") {
        //externalcode1
        this.Tab_jbxx_Data_dialog.externalcode1 = evt.row.rptitemcode;
        this.Tab_jbxx_Data_dialog.externalcode1_name = evt.row.rptitemname;
      }
      if (this.jbxx_externalcode_flag === "e2") {
        //externalcode2
        this.Tab_jbxx_Data_dialog.externalcode2 = evt.row.rptitemcode;
        this.Tab_jbxx_Data_dialog.externalcode2_name = evt.row.rptitemname;
      }
      if (this.jbxx_externalcode_flag === "e3") {
        //externalcode3
        this.Tab_jbxx_Data_dialog.externalcode3 = evt.row.rptitemcode;
        this.Tab_jbxx_Data_dialog.externalcode3_name = evt.row.rptitemname;
      }
      if (this.jbxx_externalcode_flag === "e4") {
        //externalcode4
        this.Tab_jbxx_Data_dialog.externalcode4 = evt.row.rptitemcode;
        this.Tab_jbxx_Data_dialog.externalcode4_name = evt.row.rptitemname;
      }
      if (this.jbxx_externalcode_flag === "e5") {
        //externalcode5
        this.Tab_jbxx_Data_dialog.externalcode5 = evt.row.rptitemcode;
        this.Tab_jbxx_Data_dialog.externalcode5_name = evt.row.rptitemname;
      }
      this.jbxx_dialogTable_externalcode = false;
    },
    jbxx_externalcode_tableData_close() {
      this.jbxx_externalcode_seach = "";
      this.jbxx_externalcode_flag = "";
    },
    //jbxx_externalcode_seach 前端查询
    jbxx_externalcode_seachEvent() {
      let seachstr = this.jbxx_externalcode_seach;
      this.jbxx_externalcode_tableData.splice(0, this.jbxx_externalcode_tableData.length);
      //清空数组
      if (this.jbxx_externalcode_flag === "e1") {
        for (let i = 0; i < this.jbxx_externalcode_tableDataLog[0].length; i++) {
          if (this.jbxx_externalcode_tableDataLog[0][i].rptitemcode.indexOf(seachstr) >= 0 || this.jbxx_externalcode_tableDataLog[0][i].rptitemname.indexOf(seachstr) >= 0 || this.jbxx_externalcode_tableDataLog[0][i].inputcode.indexOf(seachstr) >= 0) {
            this.jbxx_externalcode_tableData.push(this.jbxx_externalcode_tableDataLog[0][i]);
          }
        }
      }
      if (this.jbxx_externalcode_flag === "e2") {
        for (let i = 0; i < this.jbxx_externalcode_tableDataLog[1].length; i++) {
          if (this.jbxx_externalcode_tableDataLog[1][i].rptitemcode.indexOf(seachstr) >= 0 || this.jbxx_externalcode_tableDataLog[1][i].rptitemname.indexOf(seachstr) >= 0 || this.jbxx_externalcode_tableDataLog[1][i].inputcode.indexOf(seachstr) >= 0) {
            this.jbxx_externalcode_tableData.push(this.jbxx_externalcode_tableDataLog[1][i]);
          }
        }
      }
      if (this.jbxx_externalcode_flag === "e3") {
        for (let i = 0; i < this.jbxx_externalcode_tableDataLog[2].length; i++) {
          if (this.jbxx_externalcode_tableDataLog[2][i].rptitemcode.indexOf(seachstr) >= 0 || this.jbxx_externalcode_tableDataLog[2][i].rptitemname.indexOf(seachstr) >= 0 || this.jbxx_externalcode_tableDataLog[2][i].inputcode.indexOf(seachstr) >= 0) {
            this.jbxx_externalcode_tableData.push(this.jbxx_externalcode_tableDataLog[2][i]);
          }
        }
      }
    },
    jbxx_rptitemcode_change() {
      this.$tool
        .request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "validation_rptitemcode",
            rpt_itemcode: this.Tab_jbxx_Data_dialog.rpt_itemcode,
          },
        })
        .then((res) => {
          if (res == "-1") {
            this.$alert("项目代码：" + this.Tab_jbxx_Data_dialog.rpt_itemcode + "重复，请检查重复的项目代码对应的项目归类是否正确或填写新的项目代码！", "提示");
            this.Tab_jbxx_Data_dialog.rpt_itemcode = "";
          }
        })
        .catch((e) => {
          this.$message.error(e);
        });
    },
    jbxx_ref_change() {
      let ref_l = this.$pub.getdigits(this.Tab_jbxx_Data_dialog.ref_l, this.Tab_jbxx_Data_dialog.dec_digits, this.refvaldigitsmatch > 0);
      //this.Tab_jbxx_Data_dialog.ref_l + "";
      let ref_h = this.$pub.getdigits(this.Tab_jbxx_Data_dialog.ref_h, this.Tab_jbxx_Data_dialog.dec_digits, this.refvaldigitsmatch > 0);
      //this.Tab_jbxx_Data_dialog.ref_h + ""
      if (!!ref_l && !!ref_h) {
        //this.Tab_jbxx_Data_dialog.ref_text = ref_l + "--" + ref_h;
        this.Tab_jbxx_Data_dialog.ref_text = ref_l + this.refvaljoinchar + ref_h;
      } else {
        if (!!ref_l && !ref_h) {
          this.Tab_jbxx_Data_dialog.ref_text = "≥" + ref_l;
        }
        if (!ref_l && !!ref_h) {
          this.Tab_jbxx_Data_dialog.ref_text = "≤" + ref_h;
        }
      }
    },
    //高值低值
    // ckzmx_keydownEvent({ row }) {
    //     setTimeout(() => {
    //         if (row.ref_l != "" && row.ref_h != "" && row.ref_l != null && row.ref_h != null) {
    //             row.ref_text = parseFloat(row.ref_l) + "--" + parseFloat(row.ref_h);
    //         } else if (row.ref_l == "" && row.ref_h == "") {
    //             row.ref_text = "";
    //         } else {
    //             if (row.ref_l != "" && row.ref_h == "") {
    //                 row.ref_text = "≥" + parseFloat(row.ref_l);
    //             }
    //             if (row.ref_l == "" && row.ref_h != "") {
    //                 row.ref_text = "≤" + parseFloat(row.ref_h);
    //             }
    //         }
    //     }, 200);
    // },
    tab_jbxx_addEvent() {
      this.Tab_jbxx_Data_dialog = { hospcode: "ALL", germflag: "0", resulttype: "4", textresultflag: "M", seq: "0", dec_digits: "-1", inputcode: "", ref_l: "", ref_h: "", ref_text: "", rpt_itemcode: "", rptcode: "" };
      this.jbxx_rptitemcode_readonly = false;
      this.tab_ckzmx_bysex_if = false;
      this.tab_ckzmx_byage_if = false;
      this.tab_ckzmx_byspecimen_if = false;
      this.tab_ckzmx_byphysicycle_if = false;
      this.main_dialog_name = "新增";
      this.main_dialogkey++;
      this.get_wzjg_option();
      this.main_dialogflag = true;
      this.disabledKindGroup = true; //判断一级分类和二级分类是不是可以维护
      this.Tab_jbxx_Data_dialog.itemclasscode = this.search_itemclasscode;
      this.anchor = "anchor-0";
    },
    tab_jbxx_editEvent() {
      if (!this.Tab_jbxx_Data.rpt_itemcode) {
        this.$message.error("请选择修改的数据！");
        return false;
      }
      this.jbxx_rptitemcode_readonly = true;
      //console.log("sa", this.Tab_jbxx_Data);
      this.oldcompitemcode = XE.clone(this.Tab_jbxx_Data.comp_itemcode, true);
      this.Tab_jbxx_Data_dialog = XE.clone(this.Tab_jbxx_Data, true);
      this.main_dialog_name = "编辑";
      this.get_wzjg_option();
      this.main_dialogflag = true;
    }, //弹窗保存
    main_dialog_saveEvent() {
      //转换checkbox
      if (XE.isUndefined(this.Tab_jbxx_Data_dialog.itemclasscode) || this.Tab_jbxx_Data_dialog.itemclasscode == "") {
        this.$message.error("项目归类不可为空！");
        return false;
      }
      if (XE.isUndefined(this.Tab_jbxx_Data_dialog.rpt_itemcode) || this.Tab_jbxx_Data_dialog.rpt_itemcode == "") {
        this.$message.error("项目代码不可为空！");
        return false;
      }
      if (XE.isUndefined(this.Tab_jbxx_Data_dialog.rpt_itemname) || this.Tab_jbxx_Data_dialog.rpt_itemname == "") {
        this.$message.error("中文名称不可为空！");
        return false;
      }
      if (XE.isUndefined(this.Tab_jbxx_Data_dialog.germflag) || this.Tab_jbxx_Data_dialog.germflag == "") {
        this.$message.error("项目类型不可为空！");
        return false;
      }
      if (XE.isUndefined(this.Tab_jbxx_Data_dialog.itemcode_en) || this.Tab_jbxx_Data_dialog.itemcode_en == "") {
        this.$message.error("英文缩写不可为空！");
        return false;
      }
      if (XE.isUndefined(this.Tab_jbxx_Data_dialog.resulttype) || this.Tab_jbxx_Data_dialog.resulttype == "") {
        this.$message.error("结果类型不可为空！");
        return false;
      }
      if (XE.isUndefined(this.Tab_jbxx_Data_dialog.textresultflag) || this.Tab_jbxx_Data_dialog.textresultflag == "") {
        this.$message.error("默认文字结果标志不可为空！");
        return false;
      }
      if (XE.isUndefined(this.Tab_jbxx_Data_dialog.rptcode) || this.Tab_jbxx_Data_dialog.rptcode == "") {
        this.$message.error("报告代码不可为空！");
        return false;
      }
      let vsflag = "0";
      if (this.search_rptunitid != "" && this.main_dialog_name == "新增") {
        let str = this.search_rptunitname + "[" + this.search_rptunitid + "]";
        this.$confirm("您是否要将本项目自动增加到报告单元：" + str + "?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            vsflag = 1;
            this.saveEvent(vsflag);
          })
          .catch(() => {
            vsflag = 0;
            this.saveEvent(vsflag);
          });
      } else {
        this.saveEvent(vsflag);
      }
    },
    async saveEvent(vsflag) {
      let gData = XE.clone(this.Tab_jbxx_Data_dialog);
      //console.log(gData);
      gData.nostat = this.Tab_jbxx_Data_dialog.nostat ? "1" : "0";
      //gData.shareflag = this.Tab_jbxx_Data_dialog.shareflag ? "1" : "0";
      gData.stopflag = this.Tab_jbxx_Data_dialog.stopflag ? "1" : "0";
      gData.resulttwice = this.Tab_jbxx_Data_dialog.resulttwice ? "1" : "0";
      gData.isgermgroup = this.Tab_jbxx_Data_dialog.isgermgroup ? "1" : "0";
      gData.ref_bysex = this.Tab_jbxx_Data_dialog.ref_bysex ? "1" : "0";
      gData.ref_byage = this.Tab_jbxx_Data_dialog.ref_byage ? "1" : "0";
      gData.ref_byspecimen = this.Tab_jbxx_Data_dialog.ref_byspecimen ? "1" : "0";
      gData.autochkflag = this.Tab_jbxx_Data_dialog.autochkflag ? "1" : "0";
      gData.sameflagautochkok = this.Tab_jbxx_Data_dialog.sameflagautochkok ? "1" : "0";
      gData.autochk_txtresult = this.Tab_jbxx_Data_dialog.autochk_txtresult ? "1" : "0";
      gData.autochk_qtlt = this.Tab_jbxx_Data_dialog.autochk_qtlt ? "1" : "0";
      gData.mustmatchlastflag = this.Tab_jbxx_Data_dialog.mustmatchlastflag ? "1" : "0";
      gData.forbidchk_txtresult = this.Tab_jbxx_Data_dialog.forbidchk_txtresult ? "1" : "0";
      gData.mustmatchlast = this.Tab_jbxx_Data_dialog.mustmatchlast ? "1" : "0";
      gData.autoalert = this.Tab_jbxx_Data_dialog.autoalert ? "1" : "0";
      gData.iscalc = this.Tab_jbxx_Data_dialog.iscalc ? "1" : "0";
      try {
        const res = await this.$tool.request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "lab_rptitem_addedit",
            data: gData,
            vsflag: vsflag,
            rptunitid: this.search_rptunitid,
            actionindex: this.main_dialog_name,
            // modifyallflag: this.modifyallmatchflag,
          },
        });
        if (res.errcode == "1") {
          //每次保存都要重置匹配标志
          // this.modifyallmatchflag = "0";
          this.$message.success("保存成功！");
          if (this.$ddldata.IsAreaMode) {
            //区域LIS模式下还要保存默认参考值明细和文字结果，非区域LIS模式下只需要保存项目
            this.SaveLab_RptItemRef(res.keyid);
          }

          if (this.main_dialog_name == "新增") {
            //新增数据成功后的不刷新操作
            if (this.AddData.indexOf(res.keyid) < 0) {
              this.AddData.push(res.keyid);
            }
            this.$refs.Main_Table.insertAt(res.obj[0], -1).then(({ row }) => {
              this.$refs.Main_Table.scrollToRow(row);
              this.$refs.Main_Table.setCurrentRow(row);
              this.Tab_jbxx_Data.rpt_itemcode = row.rpt_itemcode;
              this.selrow = row;
            });
          } else if (this.main_dialog_name == "编辑") {
            this.setvalueToTable(res.obj[0]);
            if (this.ModData.indexOf(res.keyid) < 0) {
              this.ModData.push(res.keyid);
            }
            setTimeout(() => {
              this.$refs.Main_Table.setCurrentRow(this.selrow);
            }, 20);
          }

          //保存后是否关闭弹窗
          if (this.savenotclosedialog == "1") {
            this.tab_jbxx_addEvent();
            // this.main_dialogflag = true;
          } else {
            this.main_dialogflag = false;
            // this.jbxx_iscalc_dataOri = [];
          }
          await this.MainTable_GetDataInfo(res.keyid);
        } else if (res.errcode == "2") {
          this.$alert(res.obj, "提示");
        } else {
          this.Tab_jbxx_Data_dialog = XE.clone(this.Tab_jbxx_Data, true);
          this.$message.error(res.obj);
        }
      } catch (e) {
        this.$message.warning(e);
      }
    },
    setvalueToTable(obj) {
      this.selrow.itemclasscode = obj.itemclasscode;
      this.selrow.itemclassname = obj.itemclassname;
      this.selrow.itemcode_en = obj.itemcode_en;
      this.selrow.rpt_itemname = obj.rpt_itemname;
      this.selrow.rpt_itemcode = obj.rpt_itemcode;
      this.selrow.ref_text = obj.ref_text;
      this.selrow.unit = obj.unit;
      this.selrow.rptcode = obj.rptcode;
      this.selrow.iscalc = obj.iscalc;
      this.selrow.calc_formulatext = obj.calc_formulatext;
      this.selrow.resulttype = obj.resulttype;
      this.selrow.resulttype_name = obj.resulttype_name;
      this.selrow.dec_digits = obj.dec_digits;
      this.selrow.dec_digits_name = obj.dec_digits_name;
      this.selrow.instrclass = obj.instrclass;
      this.selrow.germflag = obj.germflag;
      this.selrow.germflag_name = obj.germflag_name;
      this.selrow.mutex_no = obj.mutex_no;
      this.selrow.transpecimen_no = obj.transpecimen_no;
      this.selrow.itemname_en = obj.itemname_en;
      this.selrow.textresultflag = obj.textresultflag;
      this.selrow.textresultflag_name = obj.textresultflag_name;
      this.selrow.ref_bysex = obj.ref_bysex;
      this.selrow.ref_byage = obj.ref_byage;
      this.selrow.ref_byspecimen = obj.ref_byspecimen;
      this.selrow.ref_byphysicycle = obj.ref_byphysicycle;
      this.selrow.ref_bydiag = obj.ref_bydiag;
      this.selrow.ref_bydept = obj.ref_bydept;
      this.selrow.ref_l = obj.ref_l;
      this.selrow.ref_h = obj.ref_h;
      this.selrow.redo_l = obj.redo_l;
      this.selrow.redo_h = obj.redo_h;
      this.selrow.autoalert = obj.autoalert;
      this.selrow.price = obj.price;
      this.selrow.inputcode = obj.inputcode;
      this.selrow.externalcode1 = obj.externalcode1;
      this.selrow.externalcode1_name = obj.externalcode1_name;
      this.selrow.externalcode2 = obj.externalcode2;
      this.selrow.externalcode2_name = obj.externalcode2_name;
      this.selrow.externalcode3 = obj.externalcode3;
      this.selrow.externalcode3_name = obj.externalcode3_name;
      this.selrow.mustmatchlast = obj.mustmatchlast;
      this.selrow.alertouthours = obj.alertouthours;
      this.selrow.hospcode = obj.hospcode;
      this.selrow.stopflag = obj.stopflag;
      this.selrow.nostat = obj.nostat;
      this.selrow.basename = obj.basename;
      this.selrow.chklastdays = obj.chklastdays;
      this.selrow.chklastratio = obj.chklastratio;
      this.selrow.chklastabs = obj.chklastabs;
      this.selrow.chkmatchflag = obj.chkmatchflag;
      this.selrow.samplequality = obj.samplequality;
      this.selrow.samplequalityname = obj.samplequalityname;
    },
    async SaveLab_RptItemRef(rpt_itemcodestr) {
      try {
        const res = await this.$tool.request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "SaveLab_RptItemRef",
            rpt_itemcodestr: rpt_itemcodestr,
            rptunitid: this.search_rptunitid,
          },
        });
        if (res.errcode != "1") {
          this.$message.error("区域LIS模式下新增时保存参考值明细和项目文字结果出错" + errmsg);
        }
      } catch (e) {
        this.$message.error("区域LIS模式下新增时保存参考值明细和项目文字结果出错" + e);
      }
    },
    main_dialog_canelEvent() {
      this.main_dialogflag = false;
    },
    tab_jbxx_delete() {
      if (this.Tab_jbxx_Data.rpt_itemcode == "") {
        this.$message.error("请先选择数据！");
        return false;
      }
      this.$confirm("此操作将永久删除该项目, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          var delrow = this.$refs.Main_Table.getCurrentRow();
          if (delrow) {
            var alld = this.$refs.Main_Table.getTableData().fullData;
            var rowindex = alld.indexOf(delrow);

            this.confirmDelete(delrow.rpt_itemcode)
              .then((res) => {
                if (res == "1") {
                  this.$pub.message(this, "删除成功！", "success");
                  this.$refs.Main_Table.remove(delrow);
                  let havedata = this.$refs.Main_Table.getTableData().fullData;
                  if (havedata.length > 0) {
                    if (rowindex >= havedata.length) rowindex = havedata.length - 1;
                    let selectrow = havedata[rowindex];
                    this.$refs.Main_Table.setCurrentRow(selectrow);
                    this.MainTable_GetDataInfo(selectrow.rpt_itemcode);
                    setTimeout(() => {
                      this.$refs.Main_Table.scrollToRow(selectrow);
                    }, 5);
                  } else {
                    this.MainTable_GetDataInfo("");
                  }
                } else {
                  this.$alert(res, "删除失败！", {
                    dangerouslyUseHTMLString: true,
                  });
                }
              })
              .catch((e) => {
                this.$message.error(e);
              });
          }
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
    confirmDelete(rpt_itemcode) {
      return this.$tool.request({
        url: "LIS/LIS1/LIS110",
        method: "post",
        data: {
          action: "lab_rptitem_delete",
          rpt_itemcode: rpt_itemcode,
        },
      });
    },
    tab_jbxx_getouthour_event() {
      this.jbxx_outhours_dialogflag = true;
      this.$tool
        .request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "get_lab_alertouthoursvsreqdept",
            rpt_itemcode: this.Tab_jbxx_Data_dialog.rpt_itemcode,
          },
        })
        .then((res) => {
          this.tab_jbxx_outhoursdata = res.Data;
        })
        .catch((e) => {
          this.$message.error(e);
        });
    },
    tab_jbxx_outhours_addEvent() {
      if (this.Tab_jbxx_Data_dialog.rpt_itemcode == "") {
        this.$message.error("请先选择数据！");
        return false;
      }
      let record = {
        rpt_itemcode: this.Tab_jbxx_Data_dialog.rpt_itemcode,
        req_deptno: "",
        alertouthours: "",
      };
      this.$refs.tab_jbxx_outhoursdata_ref.insert(record);
    },
    tab_jbxx_outhours_delEvent() {
      this.$confirm("此操作将删除所选数据, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.$refs.tab_jbxx_outhoursdata_ref.removeSelecteds();
        })
        .catch(() => { });
    },
    tab_jbxx_outhours_saveEvent() {
      this.$refs.tab_jbxx_outhoursdata_ref.validate((valid) => {
        if (valid) {
          let removeRecords = this.$refs.tab_jbxx_outhoursdata_ref.getRemoveRecords();
          let updateRecords = this.$refs.tab_jbxx_outhoursdata_ref.getUpdateRecords();
          let insertRecords = this.$refs.tab_jbxx_outhoursdata_ref.getInsertRecords();
          this.$tool
            .request({
              url: "LIS/LIS1/LIS110",
              method: "post",
              data: {
                action: "changeSave_lab_alertouthoursvsreqdept",
                removeRecords: removeRecords,
                updateRecords: updateRecords,
                insertRecords: insertRecords,
              },
            })
            .then((res) => {
              if (res == "1") {
                this.$message({
                  message: "保存成功！",
                  type: "success",
                });
                this.tab_jbxx_getouthour_event();
              } else {
                this.$message.error(res);
              }
            })
            .catch((e) => {
              this.$message.error(e);
            });
        } else {
          this.$message.error("您有数据未填写，请填写后再保存！！");
          return false;
        }
      });
    },
    tab_jbxx_outhours_canelEvent() {
      this.jbxx_outhours_dialogflag = false;
    },
    jbxx_outhours_dialog_editchange(obj) {
      let o_str = obj.old; //修改前字符串
      let n_str = obj.new; //修改后字符串
      let columnName = obj.p.column.property;
      if (columnName == "alertouthours") {
        return this.$tool.onlyNumber(n_str);
      } else {
        return n_str;
      }
    },
    tab_jbxx_limitrule_dbclick() {
      this.jbxx_limitrules_dialogflag = true;
      let limitruleslist = this.Tab_jbxx_Data_dialog.limit_rule.split("|");
      if (limitruleslist.length == 3) {
        if (limitruleslist[0] != "") {
          this.jbxx_limitrules_dialogflag_hours = limitruleslist[0];
        }
        if (limitruleslist[1] != "") {
          if (limitruleslist[1].substring(0, 1) == "+") {
            this.jbxx_limitrules_dialogflag_change = "+";
            this.jbxx_limitrules_dialogflag_cg = limitruleslist[1].substring(1);
          } else if (limitruleslist[1].substring(0, 1) == "-") {
            this.jbxx_limitrules_dialogflag_change = "-";
            this.jbxx_limitrules_dialogflag_cg = limitruleslist[1].substring(1);
          } else {
            this.jbxx_limitrules_dialogflag_change = "";
            this.jbxx_limitrules_dialogflag_cg = limitruleslist[1];
          }
        }
        if (limitruleslist[2] != "") {
          this.jbxx_limitrules_dialogflag_percent = limitruleslist[2];
        }
      } else {
        this.jbxx_limitrules_dialogflag_hours = "";
        this.jbxx_limitrules_dialogflag_change = "";
        this.jbxx_limitrules_dialogflag_cg = "";
        this.jbxx_limitrules_dialogflag_percent = "";
      }
    },
    jbxx_limitrules_dialogflag_cancelevent() {
      this.jbxx_limitrules_dialogflag = false;
      this.jbxx_limitrules_dialogflag_hours = "";
      this.jbxx_limitrules_dialogflag_change = "";
      this.jbxx_limitrules_dialogflag_cg = "";
      this.jbxx_limitrules_dialogflag_percent = "";
    },
    jbxx_limitrules_dialogflag_saveevent() {
      this.Tab_jbxx_Data_dialog.limit_rule = this.jbxx_limitrules_dialogflag_hours + "|" + this.jbxx_limitrules_dialogflag_change + this.jbxx_limitrules_dialogflag_cg + "|" + this.jbxx_limitrules_dialogflag_percent;
      this.jbxx_limitrules_dialogflag = false;
      this.jbxx_limitrules_dialogflag_hours = "";
      this.jbxx_limitrules_dialogflag_change = "";
      this.jbxx_limitrules_dialogflag_cg = "";
      this.jbxx_limitrules_dialogflag_percent = "";
    },
    jbxx_iscalc_click() {
      this.jbxx_s_calc_formula = this.Tab_jbxx_Data_dialog.calc_formula;
      this.jbxx_s_calc_formulatext = this.Tab_jbxx_Data_dialog.calc_formulatext;
      this.jbxx_iscalc_dialogflag = true;
      // this.jbxx_iscalc_getdata();
      this.jbxx_iscalc_loading = true;
      this.get_calcRptItem_data()
        .then((res) => {
          this.jbxx_iscalc_data = res.data;
          this.jbxx_iscalc_dataOri = res.data;
          this.jbxx_iscalc_loading = false;
        })
        .catch((e) => {
          this.$alert(e, "提示");
          this.jbxx_iscalc_loading = false;
        });
    },
    //计算项目计算公式向导
    jbxx_iscalc_getdata() {
      this.jbxx_iscalc_loading = true;
      this.get_calcRptItem_data()
        .then((res) => {
          this.jbxx_iscalc_data = res.data;
          this.jbxx_iscalc_loading = false;
        })
        .catch((e) => {
          this.$alert(e, "提示");
          this.jbxx_iscalc_loading = false;
        });
    },
    get_calcRptItem_data() {
      return this.$tool.request({
        url: "LIS/LIS1/LIS110",
        method: "post",
        data: {
          action: "calc_rptitem_query",
          keystr: this.jbxx_iscalc_seach,
        },
      });
    },
    jbxx_iscalc_hospital_change(code, name) {
      var str = ' "[HOSPITALCODE]" = ' + '"' + code + '" ';
      if (this.dialogResult) {
        //结果1,2,3
        this.result_iscalc_addevent(str);
      }
      if (this.jbxx_iscalc_dialogflag) {
        //代表计算公式
        this.jbxx_iscalc_addevent(str);
      }
      this.jbxx_iscalc_hospital_dialogflag = false;
    },
    jbxx_iscalc_ward_change(code, name) {
      var str = ' "[WARDNO]" = ' + '"' + code + '" ';
      if (this.dialogResult) {
        this.result_iscalc_addevent(str);
      }
      if (this.jbxx_iscalc_dialogflag) {
        this.jbxx_iscalc_addevent(str);
      }

      this.jbxx_iscalc_ward_dialogflag = false;
    },
    jbxx_iscalc_specimen_change(code, name) {
      var str = ' "[SAMPLE]" = ' + '"' + code + '" ';
      if (this.dialogResult) {
        this.result_iscalc_addevent(str);
      }
      if (this.jbxx_iscalc_dialogflag) {
        this.jbxx_iscalc_addevent(str);
      }
      this.jbxx_iscalc_specimen_dialogflag = false;
    },
    jbxx_iscalc_dept_change(code, name) {
      var str = ' "[DEPTNO]" = ' + '"' + code + '" ';
      if (this.dialogResult) {
        this.result_iscalc_addevent(str);
      }
      if (this.jbxx_iscalc_dialogflag) {
        this.jbxx_iscalc_addevent(str);
      }
      this.jbxx_iscalc_dept_dialogflag = false;
    },
    jbxx_iscalc_data_dbclick({ row, rowIndex }, event) {
      let rpt_itemcode = " [" + row.rpt_itemcode + "] ";
      // let temp = row.rpt_itemcode + "$" + row.itemcode_en;
      // if (this.jbxx_iscalc_dataOri.indexOf(temp) < 0) {
      //     this.jbxx_iscalc_dataOri.push(temp);
      // }
      this.jbxx_iscalc_addevent(rpt_itemcode);
    },
    jbxx_iscalc_addevent(addstr) {
      if (addstr == "SEX1") {
        addstr = ' "[SEX]" = "1" ';
      }
      if (addstr == "SEX2") {
        addstr = ' "[SEX]" = "2" ';
      }
      if (addstr == "pat_diag") {
        addstr = ' "[pat_diag]" ';
      }
      var elInput = document.getElementById("jbxx_calc_formula_id");
      var startPos = elInput.selectionStart;
      var endPos = elInput.selectionEnd;
      if (startPos === undefined || endPos === undefined) return;
      var txt = elInput.value;
      var result = txt.substring(0, startPos) + addstr + txt.substring(endPos);
      elInput.value = result; // 赋值给input的value
      // 重新定义光标位置
      elInput.focus();
      elInput.selectionStart = startPos + addstr.length;
      elInput.selectionEnd = startPos + addstr.length;
      this.jbxx_s_calc_formula = result;
      this.jbxx_iscalc_formulaToTtext();
    },
    jbxx_iscalc_formula_textchange() {
      this.jbxx_iscalc_formulaToTtext();
    },
    jbxx_iscalc_formulaToTtext() {
      //翻译
      //console.log("LIS110");
      let s_calc_formulatext = "";
      let s_between = "";
      let if_between = false;
      for (let i = 0; i < this.jbxx_s_calc_formula.length; i++) {
        let char = this.jbxx_s_calc_formula.substr(i, 1);
        if (char == "]") {
          if_between = false;
          if (s_between != "SEX" && s_between != "AGE" && s_between != "SAMPLE" && s_between != "DEPTNO" && s_between != "WARDNO" && s_between != "HOSPITALCODE") {
            let if_haven = false;
            // if (this.jbxx_iscalc_dataOri.length > 0) {
            //     this.jbxx_iscalc_dataOri.forEach((item) => {
            //         let element = item.split("$");
            //         if (element[0] == s_between) {
            //             if_haven = true;
            //             s_calc_formulatext += element[1];
            //         }
            //     });
            // }
            let row = this.jbxx_iscalc_dataOri.find((m) => m.rpt_itemcode == s_between);
            if (!!row) {
              if_haven = true;
              s_calc_formulatext += row.itemcode_en;
            }
            if (!if_haven) {
              s_calc_formulatext += s_between;
            }
          } else {
            s_calc_formulatext += s_between;
          }
          s_between = "";
        }
        if (if_between) {
          s_between += char;
        } else {
          s_calc_formulatext += char;
        }
        if (char == "[") {
          if_between = true;
        }
      }
      this.jbxx_s_calc_formulatext = s_calc_formulatext;
    },
    jbxx_iscalc_dialogclose() {
      this.jbxx_s_calc_formula = "";
      this.jbxx_s_calc_formulatext = "";
      this.jbxx_iscalc_seach = "";
    },
    jbxx_iscalc_dialogflag_cancelevent() {
      this.jbxx_iscalc_dialogflag = false;
    },
    jbxx_iscalc_dialogflag_saveevent() {
      this.$tool
        .request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "checkcalcformula",
            checkrules: this.jbxx_s_calc_formula,
          },
        })
        .then((res) => {
          if (res.flag == "1") {
            this.Tab_jbxx_Data_dialog.calc_formula = this.jbxx_s_calc_formula;
            this.Tab_jbxx_Data_dialog.calc_formulatext = this.jbxx_s_calc_formulatext;
            this.jbxx_iscalc_dialogflag = false;
          } else {
            this.$confirm(res.msg + "，是否确定强制保存?", "计算公式出错", {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning",
            })
              .then(() => {
                this.Tab_jbxx_Data_dialog.calc_formula = this.jbxx_s_calc_formula;
                this.Tab_jbxx_Data_dialog.calc_formulatext = this.jbxx_s_calc_formulatext;
                this.jbxx_iscalc_dialogflag = false;
              })
              .catch(() => { });
          }
        })
        .catch((e) => {
          this.$message.error(e);
        });
    },
    async init_tabbutton() {
      this.tab_jbxx_button = "none";
      this.tab_ckzmx_button = "none";
      this.tab_wzjg_button = "none";
      this.tab_lcyy_button = "none";
      this.tab_ybzh_button = "none";
      this.tab_syqk_button = "none";
      this.tab_pcxm_button = "none";
      this.tab_glxm_button = "none";
      this.tab_czjc_button = "none";
      this.tab_sqxm_button = "none"; 
    },
    //差值检查
    tab_czjc_getData() {
      this.tab_czjc_loading = true;
      this.$tool
        .request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "lab_deltacheck",
            rpt_itemcode: this.selrow.rpt_itemcode,
            rptunitid: "",
          },
        })
        .then((res) => {
          this.tab_czjc_data = res.data;
          //后台传过来的都是int类型，要改一下
          this.tab_czjc_data.forEach((item) => {
            item.diff_sign = item.diff_sign + "";
          });
          this.tab_czjc_loading = false;
        })
        .catch((e) => {
          this.$message.error(e);
        });
    },
    async tab_ckzmx_getData() {
      // console.log("ew", this.selrow.rpt_itemcode);
      this.tab_ckzmx_loading = true;
      try {
        const res = await this.$tool.request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "get_lab_rptitemref",
            rpt_itemcode: this.selrow.rpt_itemcode,
            rptunitid: "",
          },
        });
        this.keys.ckzmxkey++;
        this.tab_ckzmx_data = res.Data;
        this.tab_ckzmx_loading = false;
      } catch (e) {
        this.tab_ckzmx_loading = false;
        this.$alert(e, "提示");
      }
    },
    // tab_ckzmx_addEvent() {
    //     if (this.Tab_jbxx_Data.rpt_itemcode == "") {
    //         this.$message.error("请先选择数据！");
    //         return false;
    //     }
    //     let maxseq = 10; //默认10
    //     let o_seq = 0;
    //     let n_seq = 0;
    //     let insertRecords = this.$refs.tab_ckzmx_Table.getInsertRecords();
    //     let len = this.$refs.tab_ckzmx_Table.tableData.length;
    //     if (len > 0) {
    //         //数据库中数据遍历最大SEQ
    //         o_seq = Number(this.$refs.tab_ckzmx_Table.tableData[len - 1].seq);
    //     }
    //     if (insertRecords.length > 0) {
    //         //后添加的数据中遍历最大SEQ
    //         n_seq = Number(insertRecords[0].seq);
    //     }
    //     if (o_seq > n_seq) {
    //         maxseq += o_seq;
    //     } else {
    //         maxseq += n_seq;
    //     }

    //     let record = {
    //         rpt_itemcode: this.Tab_jbxx_Data.rpt_itemcode,
    //         rptunitid: 0,
    //         patsex: "All",
    //         ageyear1: -1,
    //         ageyear2: -1,
    //         specimen_code: "All",
    //         physicycle: "All",
    //         diag_icd: "All",
    //         deptno: "All",
    //         ref_l: "",
    //         ref_h: "",
    //         ref_text: "",
    //         redo_l: null,
    //         redo_h: null,
    //         autochk_l: null,
    //         autochk_h: null,
    //         seq: maxseq,
    //     };
    //     this.$refs.tab_ckzmx_Table.insert(record);
    // },
    // tab_ckzmx_delete() {
    //     let removeRecords = this.$refs.tab_ckzmx_Table.getSelectRecords();
    //     if (removeRecords.length <= 0) {
    //         this.$message.error("请先选择数据！");
    //         return false;
    //     }
    //     this.$confirm("此操作将删除所选数据, 是否继续?", "提示", {
    //         confirmButtonText: "确定",
    //         cancelButtonText: "取消",
    //         type: "warning",
    //     })
    //         .then(() => {
    //             this.$refs.tab_ckzmx_Table.removeSelecteds();
    //             this.tab_ckzmx_save(); //直接调用删除参考值明细
    //         })
    //         .catch(() => {});
    // },
    //参考值明细保存
    tab_ckzmx_save() {
      let data = this.$refs.tab_ckzmx_Table.$refs.xTableRptitemRef.tableData;
      //this.$refs.tab_ckzmx_Table.tableData;
      data.forEach((item) => {
        item.patsex = !item.patsex ? "All" : item.patsex;
        //这个不能加
        // item.ageyear1 = item.ageyear1 == "" ? "-1" : item.ageyear1;
        // item.ageyear2 = item.ageyear2 == "" ? "-1" : item.ageyear2;
        item.specimen_code = !item.specimen_code ? "All" : item.specimen_code;
        item.physicycle = !item.physicycle ? "All" : item.physicycle;
        item.diag_icd = !item.diag_icd ? "All" : item.diag_icd;
        item.deptno = !item.deptno ? "All" : item.deptno;
      });
      this.$pub.ResetSeq(data, "seq");
      this.$refs.tab_ckzmx_Table.$refs.xTableRptitemRef.validate((valid) => {
        if (valid) {
          let removeRecords = this.$refs.tab_ckzmx_Table.$refs.xTableRptitemRef.getRemoveRecords();
          let updateRecords = this.$refs.tab_ckzmx_Table.$refs.xTableRptitemRef.getUpdateRecords();
          let insertRecords = this.$refs.tab_ckzmx_Table.$refs.xTableRptitemRef.getInsertRecords();
          this.$tool
            .request({
              url: "LIS/LIS1/LIS110",
              method: "post",
              data: {
                action: "changeSave_lab_rptitemref",
                removeRecords: removeRecords,
                updateRecords: updateRecords,
                insertRecords: insertRecords,
              },
            })
            .then((res) => {
              if (res.errcode == "1") {
                this.$pub.message(this, "保存成功！", "success");
                this.tab_ckzmx_getData();
              } else {
                this.$alert(res.errmsg, "提示");
              }
            })
            .catch((e) => {
              this.$message.error(e);
            });
        } else {
          this.$message.error("您有数据未填写，请填写后再保存！！");
          return false;
        }
      });
    },
    // tab_ckzmx_editchange(obj) {
    //     let o_str = obj.old; //修改前字符串
    //     let n_str = obj.new; //修改后字符串
    //     let columnName = obj.p.column.property;
    //     if (columnName == "ageyear1" || columnName == "ageyear2" || columnName == "ref_l" || columnName == "ref_h" || columnName == "redo_l" || columnName == "redo_h" || columnName == "autochk_l" || columnName == "autochk_h") {
    //         return this.$tool.onlyNumber(n_str);
    //     } else {
    //         return n_str;
    //     }
    // },
    async tab_wzjg_getData() {
      this.reskey++;
      this.tab_wzjg_loading = true;
      try {
        const res = await this.$tool.request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "get_lab_rptitemval",
            rpt_itemcode: this.selrow.rpt_itemcode,
          },
        });
        if (res.Data.length > 0) {
          this.tab_wzjg_data = res.Data;
        } else {
          this.tab_wzjg_data = [];
        }
        this.tab_wzjg_loading = false;
      } catch (e) {
        this.tab_wzjg_loading = false;
        this.$message.error(e);
      }
    },
    get_wzjg_option() {
      this.$tool
        .request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "get_lab_rptitemval_option",
            rpt_itemcode: this.selrow.rpt_itemcode,
          },
        })
        .then((res) => {
          if (res && res.length > 0) {
            this.haswzjg = "1";
            this.wzjgOption = res;
          } else {
            this.haswzjg = "0";
            this.wzjgOption = [];
          }
        });
    },
    tab_wzjg_redoflag(row) {
      if (row.redoflag == "1") {
        row.redoflag = "";
      } else {
        row.redoflag = "1";
      }
    },
    tab_wzjg_addEvent(tvalue, resultf) {
      if (this.Tab_jbxx_Data.rpt_itemcode == "") {
        this.$message.error("请先选择数据！");
        return false;
      }
      let maxseq = 10; //默认10
      let o_seq = 0;
      let n_seq = 0;
      let insertRecords = this.$refs.tab_wzjg_Table.getInsertRecords();
      if (this.tab_wzjg_data.length > 0) {
        //数据库中数据遍历最大SEQ
        o_seq = Number(this.tab_wzjg_data[this.tab_wzjg_data.length - 1].seq);
      }
      if (insertRecords.length > 0) {
        //后添加的数据中遍历最大SEQ
        n_seq = Number(insertRecords[0].seq);
      }
      if (o_seq > n_seq) {
        maxseq += o_seq;
      } else {
        maxseq += n_seq;
      }

      let record = {
        rpt_itemcode: this.Tab_jbxx_Data.rpt_itemcode,
        textvalue: tvalue,
        inputcode: "",
        result_flag: resultf,
        redoflag: "0",
        resultkind: "0",
        canautochk: "0",
        containtext: "",
        seq: maxseq,
      };
      this.$refs.tab_wzjg_Table.insert(record);
    },
    tab_wzjg_delete() {
      let removeRecords = this.$refs.tab_wzjg_Table.getSelectRecords();
      if (removeRecords.length <= 0) {
        this.$message.error("请先选择数据！");
        return false;
      }
      this.$confirm("此操作将删除所选数据, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.$refs.tab_wzjg_Table.removeSelecteds();
          this.tab_wzjg_save(); //直接调用删除
        })
        .catch(() => { });
    },
    tab_wzjg_addPN() {
      let insertRecords = this.$refs.tab_wzjg_Table.getInsertRecords();
      let yangX = false;
      let yinX = false;
      let ruoyangX = false;
      //循环数据库数据 判断是否有部分数据
      for (let i = 0; i < this.tab_wzjg_data.length; i++) {
        if (this.tab_wzjg_data[i].textvalue.replace(/\s+/g, "") == "阴性") {
          yinX = true;
        }
        if (this.tab_wzjg_data[i].textvalue.replace(/\s+/g, "") == "阳性") {
          yangX = true;
        }
        if (this.tab_wzjg_data[i].textvalue.replace(/\s+/g, "") == "弱阳性") {
          ruoyangX = true;
        }
      }
      //循环新添加的数据 判断是否有部分数据
      for (let i = 0; i < insertRecords.length; i++) {
        if (insertRecords[i].textvalue.replace(/\s+/g, "") == "阴性") {
          yinX = true;
        }
        if (insertRecords[i].textvalue.replace(/\s+/g, "") == "阳性") {
          yangX = true;
        }
        if (insertRecords[i].textvalue.replace(/\s+/g, "") == "弱阳性") {
          ruoyangX = true;
        }
      }
      if (!yinX) {
        this.tab_wzjg_addEvent("阴性", "N");
      }
      if (!yangX) {
        this.tab_wzjg_addEvent("阳性", "P");
      }
      if (!ruoyangX) {
        this.tab_wzjg_addEvent("弱阳性", "Q");
      }
    },
    tab_wzjg_save() {
      let data = this.$refs.tab_wzjg_Table.tableData;
      let keyArr = [];
      let haveflag = false;
      try {
        data.forEach((item) => {
          if (keyArr.indexOf(item.textvalue) < 0) {
            keyArr.push(item.textvalue);
          } else {
            haveflag = true;
            throw ERROR();
          }
        });
      } catch (e) { }
      if (haveflag) {
        this.$message.error("文字结果不能重复！");
        return false;
      }
      data.sort((a, b) => {
        return a.seq - b.seq;
      });
      this.$refs.tab_wzjg_Table.validate((valid) => {
        if (valid) {
          let removeRecords = this.$refs.tab_wzjg_Table.getRemoveRecords();
          let updateRecords = this.$refs.tab_wzjg_Table.getUpdateRecords();
          let insertRecords = this.$refs.tab_wzjg_Table.getInsertRecords();
          this.$tool
            .request({
              url: "LIS/LIS1/LIS110",
              method: "post",
              data: {
                action: "save_lab_rptitemval",
                removeRecords: removeRecords,
                updateRecords: updateRecords,
                insertRecords: insertRecords,
              },
            })
            .then((res) => {
              if (res == "1") {
                this.$message({
                  message: "保存成功！",
                  type: "success",
                });
                this.tab_wzjg_getData();
              } else {
                this.$message.error(res);
              }
            })
            .catch((e) => {
              this.$message.error(e);
            });
        } else {
          this.$message.error("您有数据未填写，请填写后再保存！！");
          return false;
        }
      });
    },
    tab_wzjg_export() {
      //window.open("https://localhost:5002/z/uimg");
      let p = { prgno: "LIS110", pageinfo: "文字结果", rpt_itemcode: this.Tab_jbxx_Data.rpt_itemcode };
      this.$pub.commexport(this, p, `文字结果.dat`);
    },
    tab_wzjg_import() {
      this.$rm_uploadFiles({
        type: "文件上传",
        prgname: "LIS110",
        param1: this.Tab_jbxx_Data.rpt_itemcode,
        btn: {
          confirmBtnText: "立即上传",
          cancelBtnText: "取消",
        },
      })
        .then((res) => {
          if (res.flag == "1") {
            this.$notify.success({
              title: "成功",
              message: `文件上传成功`,
            });
            this.tab_wzjg_getData();
          } else {
            this.$notify.error({
              title: "错误",
              message: `文件上传失败`,
            });
          }
        })
        .catch((e) => {
          console.log("error", e);
        });
    },
    //临床意义保存
    tab_lcyy_save() {
      this.$tool
        .request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "save_lab_rpotitem_lcyy",
            rpt_itemcode: this.Tab_jbxx_Data.rpt_itemcode,
            clinicsign: this.Tab_jbxx_Data.clinicsign,
          },
        })
        .then((res) => {
          if (res == "1") {
            this.$message({
              message: "保存成功！",
              type: "success",
            });
          } else {
            this.$message.error(res);
          }
        })
        .catch((e) => {
          this.$message.error(e);
        });
    },
    async tab_ybzh_getData() {
      this.tab_ybzh_loading = true;
      try {
        const res = await this.$tool.request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "get_lab_itemTransSpecimen",
            rpt_itemcode: this.selrow.rpt_itemcode,
          },
        });
        this.tab_ybzh_data = res.Data;
        this.tab_ybzh_loading = false;
      } catch (e) {
        this.tab_ybzh_loading = false;
        this.$message.error(e);
      }
    },
    tab_ybzh_addEvent() {
      if (this.Tab_jbxx_Data.rpt_itemcode == "") {
        this.$message.error("请先选择数据！");
        return false;
      }
      let record = {
        rpt_itemcode: this.Tab_jbxx_Data.rpt_itemcode,
        specimencode: "",
        destrptItemcode: "",
      };
      this.$refs.tab_ybzh_Table.insert(record);
    },
    tab_ybzh_delete() {
      let removeRecords = this.$refs.tab_ybzh_Table.getSelectRecords();
      if (removeRecords.length <= 0) {
        this.$message.error("请先选择数据！");
        return false;
      }
      this.$confirm("此操作将删除所选数据, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.$refs.tab_ybzh_Table.removeSelecteds();
          this.tab_ybzh_save(); //直接删除样本转换
        })
        .catch(() => { });
    },
    tab_ybzh_save() {
      this.$refs.tab_ybzh_Table.validate((valid) => {
        if (valid) {
          let removeRecords = this.$refs.tab_ybzh_Table.getRemoveRecords();
          let updateRecords = this.$refs.tab_ybzh_Table.getUpdateRecords();
          let insertRecords = this.$refs.tab_ybzh_Table.getInsertRecords();
          this.$tool
            .request({
              url: "LIS/LIS1/LIS110",
              method: "post",
              data: {
                action: "save_lab_itemTransSpecimen",
                removeRecords: removeRecords,
                updateRecords: updateRecords,
                insertRecords: insertRecords,
              },
            })
            .then((res) => {
              if (res == "1") {
                this.$message({
                  message: "保存成功！",
                  type: "success",
                });
                this.tab_ybzh_getData();
              } else {
                this.$message.error(res);
              }
            })
            .catch((e) => {
              this.$message.error(e);
            });
        } else {
          this.$message.error("您有数据未填写，请填写后再保存！！");
          return false;
        }
      });
    },
    // 使用情况
    async tab_syqk_getData() {
      this.tab_syqk_loading = true;
      try {
        const res = await this.$tool.request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "get_lab_rptunit_item",
            rpt_itemcode: this.selrow.rpt_itemcode,
          },
        });
        this.tab_syqk_data = res.Data;
        this.loadFirstRow(this.$refs.tab_syqk1_Table, this.tab_syqk2_getdata);
        this.tab_syqk_loading = false;
      } catch (e) {
        this.tab_syqk_loading = false;
        this.$message.error(e);
      }
    },

    async querycensus() {
      this.tab_syqk_loading = true;
      try {
        const res = await this.$tool.request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          timeout: 600000,
          data: {
            action: "get_census",
            rpt_itemcode: this.selrow.rpt_itemcode,
          },
        });
        if (res.Data != null && res.Data.length > 0) {
          if (this.tab_syqk_data.length > 0) {
            for (let i = 0; i < this.tab_syqk_data.length; i++) {
              let item = this.tab_syqk_data[i];
              for (let index = 0; index < res.Data.length; index++) {
                let element = res.Data[index];
                if (this.IsAreaMode) {
                  if (parseInt(element.rptunitid) == parseInt(item.rptunitid) && toString(element.hospcode) == toString(item.hospcode)) {
                    item.resultcnt = element.resultcnt;
                    break;
                  }
                } else {
                  if (parseInt(element.rptunitid) == parseInt(item.rptunitid)) {
                    item.resultcnt = element.resultcnt;
                    break;
                  }
                }
              }
            }
          } else {
            this.tab_syqk_data = res.Data;
          }
        }
        this.tab_syqk_loading = false;
      } catch (e) {
        this.tab_syqk_loading = false;
        this.$message.error(e);
      }
    },

    //自动加载表格的第一行，并执行回调函数
    loadFirstRow(xTable, func) {
      this.$nextTick(() => {
        // 加载第一行
        var selectrow = xTable.getData(0);
        if (selectrow) {
          xTable.setCurrentRow(selectrow); //高亮行
          xTable.scrollToRow(selectrow); //滚动到行
          // this.tab_syqk_data_rptunitid = selectrow.rptunitid;
          if (typeof func == "function") func(selectrow.rptunitid);
        } else {
          xTable.setCurrentRow(null); //这个不会自动清空
          func("");
        }
      });
    },
    tab_syqk_data_change({ row }) {
      //  this.tab_syqk_data_rptunitid = row.rptunitid;
      this.tab_syqk2_getdata(row.rptunitid);
    },
    //使用情况参考值
    async tab_syqk2_getdata(rptunitid) {
      this.tab_syqk_ckzmx_loading = true;
      this.tab_syqk_data_rptunitid = rptunitid;
      try {
        const res = await this.$tool.request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "get_lab_rptitemref",
            rpt_itemcode: this.selrow.rpt_itemcode,
            rptunitid: this.tab_syqk_data_rptunitid,
          },
        });
        this.keys.syqkkey++;
        this.tab_syqk_ckzmx_data = res.Data;
        this.tab_syqk_ckzmx_loading = false;
      } catch (e) {
        this.tab_syqk_ckzmx_loading = false;
        this.$message.error(e);
      }
    },
    //使用情况新增
    // tab_syqk_addEvent() {
    //     if (this.Tab_jbxx_Data.rpt_itemcode == "") {
    //         this.$message.error("请先选择数据！");
    //         return false;
    //     }
    //     if (this.tab_syqk_data_rptunitid == "") {
    //         this.$message.error("请先在LIS32报告单元对照报告项目中完成该报告项目与报告单元的对照！");
    //         return false;
    //     }
    //     let maxseq = 10; //默认10
    //     let o_seq = 0;
    //     let n_seq = 0;
    //     let insertRecords = this.$refs.tab_syqk2_Table.getInsertRecords();
    //     let len = this.$refs.tab_syqk2_Table.tableData.length;
    //     if (len > 0) {
    //         //数据库中数据遍历最大SEQ
    //         o_seq = Number(this.$refs.tab_syqk2_Table.tableData[len - 1].seq);
    //     }
    //     if (insertRecords.length > 0) {
    //         //后添加的数据中遍历最大SEQ
    //         n_seq = Number(insertRecords[0].seq);
    //     }
    //     if (o_seq > n_seq) {
    //         maxseq += o_seq;
    //     } else {
    //         maxseq += n_seq;
    //     }
    //     let record = {
    //         rpt_itemcode: this.Tab_jbxx_Data.rpt_itemcode,
    //         rptunitid: this.tab_syqk_data_rptunitid,
    //         patsex: "All",
    //         ageyear1: -1,
    //         ageyear2: -1,
    //         specimen_code: "All",
    //         physicycle: "All",
    //         diag_icd: "All",
    //         deptno: "All",
    //         ref_l: "",
    //         ref_h: "",
    //         ref_text: "",
    //         redo_l: null,
    //         redo_h: null,
    //         autochk_l: null,
    //         autochk_h: null,
    //         seq: maxseq,
    //     };
    //     this.$refs.tab_syqk2_Table.insert(record);
    // }, //使用情况删除
    // tab_syqk_delete() {
    //     let removeRecords = this.$refs.tab_syqk2_Table.getSelectRecords();
    //     if (removeRecords.length <= 0) {
    //         this.$message.error("请先选择数据！");
    //         return false;
    //     }
    //     this.$confirm("此操作将删除所选数据, 是否继续?", "提示", {
    //         confirmButtonText: "确定",
    //         cancelButtonText: "取消",
    //         type: "warning",
    //     })
    //         .then(() => {
    //             this.$refs.tab_syqk2_Table.removeSelecteds();
    //             this.tab_syqk_button(); //直接删除使用情况
    //         })
    //         .catch(() => {});
    // },
    //使用情况保存
    tab_syqk_save() {
      let data = this.$refs.tab_syqk2_Table.$refs.xTableRptitemRef.tableData;
      data.forEach((item) => {
        item.patsex = !item.patsex ? "All" : item.patsex;
        //这个不能加,加上再次保存会把0变成-1
        // item.ageyear1 = item.ageyear1 == "" ? "-1" : item.ageyear1;
        // item.ageyear2 = item.ageyear2 == "" ? "-1" : item.ageyear2;
        item.specimen_code = !item.specimen_code ? "All" : item.specimen_code;
        item.physicycle = !item.physicycle ? "All" : item.physicycle;
        item.diag_icd = !item.diag_icd ? "All" : item.diag_icd;
        item.deptno = !item.deptno ? "All" : item.deptno;
      });
      this.$pub.ResetSeq(data, "seq");
      this.$refs.tab_syqk2_Table.$refs.xTableRptitemRef.validate((valid) => {
        if (valid) {
          let removeRecords = this.$refs.tab_syqk2_Table.$refs.xTableRptitemRef.getRemoveRecords();
          let updateRecords = this.$refs.tab_syqk2_Table.$refs.xTableRptitemRef.getUpdateRecords();
          let insertRecords = this.$refs.tab_syqk2_Table.$refs.xTableRptitemRef.getInsertRecords();
          this.$tool
            .request({
              url: "LIS/LIS1/LIS110",
              method: "post",
              data: {
                action: "changeSave_lab_rptitemref",
                removeRecords: removeRecords,
                updateRecords: updateRecords,
                insertRecords: insertRecords,
              },
            })
            .then((res) => {
              if (res.errcode == "1") {
                this.$pub.message(this, "保存成功！", "success");
                this.tab_syqk2_getdata(this.tab_syqk_data_rptunitid);
              } else {
                this.$alert(res.errmsg, "提示");
              }
            })
            .catch((e) => {
              this.$message.error(e);
            });
        } else {
          this.$message.error("您有数据未填写，请填写后再保存！！");
          return false;
        }
      });
    },
    //互斥项目查询
    async tab_pcxm_getData() {
      this.tab_pcxm_loading = true;
      try {
        const res = await this.$tool.request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "get_lab_rptitem_mutex",
            rpt_itemcode: this.selrow.rpt_itemcode,
          },
        });
        this.tab_pcxm_data = res.Data;
        this.tab_pcxm_loading = false;
      } catch (e) {
        this.$message.error(e);
        this.tab_pcxm_loading = false;
      }
    },

    //互斥项目新增
    tab_pcxm_addEvent() {
      if (this.Tab_jbxx_Data.rpt_itemcode == "") {
        this.$message.error("请先选择数据！");
        return false;
      }
      let maxseq = 10; //默认10
      let o_seq = 0;
      let n_seq = 0;
      let insertRecords = this.$refs.tab_pcxm_Table.getInsertRecords();
      if (this.tab_pcxm_data.length > 0) {
        //数据库中数据遍历最大SEQ
        o_seq = Number(this.tab_pcxm_data[this.tab_pcxm_data.length - 1].seq);
      }
      if (insertRecords.length > 0) {
        //后添加的数据中遍历最大SEQ
        n_seq = Number(insertRecords[0].seq);
      }
      if (o_seq > n_seq) {
        maxseq += o_seq;
      } else {
        maxseq += n_seq;
      }
      let record = {
        rpt_itemcode: this.Tab_jbxx_Data.rpt_itemcode,
        mutex_rptitemcode: "",
        seq: maxseq,
      };
      this.$refs.tab_pcxm_Table.insert(record);
    },
    //互斥项目删除
    tab_pcxm_delete() {
      let removeRecords = this.$refs.tab_pcxm_Table.getSelectRecords();
      if (removeRecords.length <= 0) {
        this.$message.error("请先选择数据！");
        return false;
      }
      this.$confirm("此操作将删除所选数据, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.$refs.tab_pcxm_Table.removeSelecteds();
          this.tab_pcxm_save(); //直接删除互斥项目
        })
        .catch(() => { });
    },
    //互斥项目保存
    async tab_pcxm_save() {
      this.$pub.ResetSeq(this.$refs.tab_pcxm_Table.tableData, "seq");
      this.$refs.tab_pcxm_Table.validate((valid) => {
        if (valid) {
          let removeRecords = this.$refs.tab_pcxm_Table.getRemoveRecords();
          let updateRecords = this.$refs.tab_pcxm_Table.getUpdateRecords();
          let insertRecords = this.$refs.tab_pcxm_Table.getInsertRecords();
          if (removeRecords.length + updateRecords.length + insertRecords.length > 0) {
            this.$tool
              .request({
                url: "LIS/LIS1/LIS110",
                method: "post",
                data: {
                  action: "save_lab_rptitem_mutex",
                  removeRecords: removeRecords,
                  updateRecords: updateRecords,
                  insertRecords: insertRecords,
                },
              })
              .then((res) => {
                if (res == "1") {
                  this.$pub.message(this, "保存成功！", "success");
                  this.tab_pcxm_getData();
                  console.log("000");
                } else {
                  this.$message.error(res);
                }
              })
              .catch((e) => {
                this.$message.error(e);
              });
          }
        } else {
          this.$message.error("您有数据未填写，请填写后再保存！！");
          return false;
        }
      });
    },
    //关联项目查询
    async tab_glxm_getData() {
      this.tab_glxm_loading = true;
      try {
        const res = await this.$tool.request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "get_lab_rptitem_link",
            rpt_itemcode: this.selrow.rpt_itemcode,
          },
        });
        this.tab_glxm_data = res.Data;
        this.tab_glxm_loading = false;
      } catch (e) {
        this.$message.error(e);
        this.tab_glxm_loading = false;
      }
    },
    //关联项目新增
    tab_glxm_addEvent() {
      if (this.Tab_jbxx_Data.rpt_itemcode == "") {
        this.$message.error("请先选择数据！");
        return false;
      }
      let maxseq = 10; //默认10
      let o_seq = 0;
      let n_seq = 0;
      let insertRecords = this.$refs.tab_glxm_Table.getInsertRecords();
      if (this.tab_glxm_data.length > 0) {
        //数据库中数据遍历最大SEQ
        o_seq = Number(this.tab_glxm_data[this.tab_glxm_data.length - 1].seq);
      }
      if (insertRecords.length > 0) {
        //后添加的数据中遍历最大SEQ
        n_seq = Number(insertRecords[0].seq);
      }
      if (o_seq > n_seq) {
        maxseq += o_seq;
      } else {
        maxseq += n_seq;
      }
      let record = {
        rpt_itemcode: this.Tab_jbxx_Data.rpt_itemcode,
        link_rptitemcode: "",
        seq: maxseq,
      };
      this.$refs.tab_glxm_Table.insert(record);
    },
    //关联项目删除
    tab_glxm_delete() {
      let removeRecords = this.$refs.tab_glxm_Table.getSelectRecords();
      if (removeRecords.length <= 0) {
        this.$message.error("请先选择数据！");
        return false;
      }
      this.$confirm("此操作将删除所选数据, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.$refs.tab_glxm_Table.removeSelecteds();
          this.tab_glxm_save(); //直接删除互斥项目
        })
        .catch(() => { });
    },
    //关联项目保存
    async tab_glxm_save() {
      this.$pub.ResetSeq(this.$refs.tab_glxm_Table.tableData, "seq");
      this.$refs.tab_glxm_Table.validate((valid) => {
        if (valid) {
          let removeRecords = this.$refs.tab_glxm_Table.getRemoveRecords();
          let updateRecords = this.$refs.tab_glxm_Table.getUpdateRecords();
          let insertRecords = this.$refs.tab_glxm_Table.getInsertRecords();
          if (removeRecords.length + updateRecords.length + insertRecords.length > 0) {
            this.$tool
              .request({
                url: "LIS/LIS1/LIS110",
                method: "post",
                data: {
                  action: "save_lab_rptitem_link",
                  removeRecords: removeRecords,
                  updateRecords: updateRecords,
                  insertRecords: insertRecords,
                },
              })
              .then((res) => {
                if (res == "1") {
                  this.$pub.message(this, "保存成功！", "success");
                  this.tab_glxm_getData();
                } else {
                  this.$message.error(res);
                }
              })
              .catch((e) => {
                this.$message.error(e);
              });
          }
        } else {
          this.$message.error("您有数据未填写，请填写后再保存！！");
          return false;
        }
      });
    },
    //差值检查新增
    tab_czjc_addEvent() {
      if (this.Tab_jbxx_Data.rpt_itemcode == "") {
        this.$message.error("请先选择数据！");
        return false;
      }
      let maxseq = 10; //默认10
      let o_seq = 0;
      let n_seq = 0;
      let insertRecords = this.$refs.tab_czjc_Table.getInsertRecords();
      if (this.tab_czjc_data.length > 0) {
        //数据库中数据遍历最大SEQ
        o_seq = Number(this.tab_czjc_data[this.tab_czjc_data.length - 1].seq);
      }
      if (insertRecords.length > 0) {
        //后添加的数据中遍历最大SEQ
        n_seq = Number(insertRecords[0].seq);
      }
      if (o_seq > n_seq) {
        maxseq += o_seq;
      } else {
        maxseq += n_seq;
      }
      let record = {
        rpt_itemcode: this.Tab_jbxx_Data.rpt_itemcode,
        manualchk_use: "1",
        autochk_use: "1",
        stopflag: "0",
        diff_sign: "0",
        pat_typecode: "All",
        req_deptno: "All",
        specimen_code: "All",
        hospcode: this.$ddldata.IsAreaMode ? this.$tool.getSession(this.$tool.selectedhis) : "All",
        seq: maxseq,
      };
      this.$refs.tab_czjc_Table.insert(record);
    },
    //差值检查删除
    tab_czjc_delete() {
      let removeRecords = this.$refs.tab_czjc_Table.getSelectRecords();
      if (removeRecords.length <= 0) {
        this.$message.error("请先选择数据！");
        return false;
      }
      this.$confirm("此操作将删除所选数据, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.$refs.tab_czjc_Table.removeSelecteds();
          this.tab_czjc_save(); //直接删除差值检查
        })
        .catch(() => { });
    },
    //差值检查保存
    tab_czjc_save() {
      this.$pub.ResetSeq(this.$refs.tab_glxm_Table.tableData, "seq");
      this.$refs.tab_czjc_Table.validate((valid) => {
        if (valid) {
          let removeRecords = this.$refs.tab_czjc_Table.getRemoveRecords();
          let updateRecords = this.$refs.tab_czjc_Table.getUpdateRecords();
          let insertRecords = this.$refs.tab_czjc_Table.getInsertRecords();
          this.$tool
            .request({
              url: "LIS/LIS1/LIS110",
              method: "post",
              data: {
                action: "save_lab_deltacheck",
                removeRecords: removeRecords,
                updateRecords: updateRecords,
                insertRecords: insertRecords,
              },
            })
            .then((res) => {
              if (res == "1") {
                this.$pub.message(this, "保存成功！", "success");
                this.tab_czjc_getData();
              } else {
                this.$message.error(res);
              }
            })
            .catch((e) => {
              this.$message.error(e);
            });
        } else {
          this.$message.error("您有数据未填写，请填写后再保存！！");
          return false;
        }
      });
    },
    async tab_sqxm_getData() {
      console.info("111111111111");
      this.tab_sqxm_loading = true;
      try {
        const res = await this.$tool.request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "get_req_item",
            rpt_itemcode: this.selrow.rpt_itemcode,
          },
        });
        this.tab_sqxm_data = res.data;
        this.tab_sqxm_loading = false;
      } catch (e) {
        this.$message.error(e);
        this.tab_sqxm_loading = false;
      }
    },
    tab_sqxm_addEvent() {
      // 申请项目弹窗
      this.req_itemdialog = true;
    },
    tab_sqxm_delete() {
      let removeRecords = this.$refs.tab_sqxm_Table.getSelectRecords();
      if (removeRecords.length <= 0) {
        this.$message.error("请先选择数据！");
        return false;
      }
      this.$confirm("此操作将删除所选数据, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.$refs.tab_sqxm_Table.removeSelecteds();
          this.tab_sqxm_save(); //直接删除差值检查
        })
        .catch(() => { });
    },
    tab_sqxm_save() {
      this.$pub.ResetSeq(this.$refs.tab_glxm_Table.tableData, "seq");
      this.$refs.tab_czjc_Table.validate((valid) => {
        if (valid) {
          let removeRecords = this.$refs.tab_sqxm_Table.getRemoveRecords();
          let updateRecords = this.$refs.tab_sqxm_Table.getUpdateRecords();
          let insertRecords = this.$refs.tab_sqxm_Table.getInsertRecords();
          this.$tool
            .request({
              url: "LIS/LIS1/LIS110",
              method: "post",
              data: {
                action: "save_req_item",
                removeRecords: removeRecords,
                updateRecords: updateRecords,
                insertRecords: insertRecords,
              },
            })
            .then((res) => {
              if (res == "1") {
                this.$pub.message(this, "保存成功！", "success");
                this.tab_sqxm_getData();
              } else {
                this.$message.error(res);
              }
            })
            .catch((e) => {
              this.$message.error(e);
            });
        } else {
          this.$message.error("您有数据未填写，请填写后再保存！！");
          return false;
        }
      });
    },
    tab_sqxm_copy() {
      var data = this.$refs.tab_sqxm_Table.tableData;
      if (data.length == 0) {
        this.$message.warning("没有可复制的数据！");
        return false;
      }
      this.tableCopyData = JSON.parse(JSON.stringify(data));
    },
    tab_sqxm_paste() {
      var tempdata = JSON.parse(JSON.stringify(this.tableCopyData));
      var seq = 0;
      var len = this.$refs.tab_sqxm_Table.tableData.length;
      if (len != 0) {
        seq = this.$refs.tab_sqxm_Table.tableData[len - 1].seq - 0;
      }

      for (let i = 0; i < tempdata.length; i++) {
        var finddata = this.$refs.tab_sqxm_Table.tableData.filter((item) => {
          return item.req_itemcode == tempdata[i].req_itemcode;
        });
        if (finddata.length == 0) {
          let maxseq = 10; //默认10
          let o_seq = 0;
          let n_seq = 0;
          let insertRecords = this.$refs.tab_sqxm_Table.getInsertRecords();
          if (this.tab_sqxm_data.length > 0) {
            //数据库中数据遍历最大SEQ
            o_seq = Number(this.tab_sqxm_data[this.tab_sqxm_data.length - 1].seq);
          }
          if (insertRecords.length > 0) {
            //后添加的数据中遍历最大SEQ
            n_seq = Number(insertRecords[0].seq);
          }
          if (o_seq > n_seq) {
            maxseq += o_seq;
          } else {
            maxseq += n_seq;
          }
          tempdata[i].seq = maxseq;
          tempdata[i].rpt_itemcode = this.selrow.rpt_itemcode;

          this.$refs.tab_sqxm_Table.insertAt(tempdata[i], -1);
        }
      }
    },
    tab_sqxmdblclick() { },
    req_itemchange(c, v) {
      let data = this.$refs.tab_sqxm_Table.getTableData().fullData;
      var code = "";
      var name = "";
      if (data.length > 1) {
        let fdata = data.filter((m) => m.req_itemcode == c);
        if (fdata.length > 0) {
          this.$alert("所选申请项目【" + v + "】已存在列表中，请重新选择！", "信息");
          return false;
        } else {
          code = c;
          name = v;
        }
      } else {
        code = c;
        name = v;
      }
      this.req_itemdialog = false;

      let maxseq = 10; //默认10
      let o_seq = 0;
      let n_seq = 0;
      let insertRecords = this.$refs.tab_sqxm_Table.getInsertRecords();
      if (this.tab_sqxm_data.length > 0) {
        //数据库中数据遍历最大SEQ
        o_seq = Number(this.tab_sqxm_data[this.tab_sqxm_data.length - 1].seq);
      }
      if (insertRecords.length > 0) {
        //后添加的数据中遍历最大SEQ
        n_seq = Number(insertRecords[0].seq);
      }
      if (o_seq > n_seq) {
        maxseq += o_seq;
      } else {
        maxseq += n_seq;
      }
      let record = {
        rpt_itemcode: this.Tab_jbxx_Data.rpt_itemcode,
        req_itemcode: code,
        req_itemname: name,
        seq: maxseq,
      };
      this.$refs.tab_sqxm_Table.insert(record);
      // this.HasChange();
    },
    //"rm-cancel"; //作废
    //"rm-disable"; //禁用
    //"rm-readonly"; //只读
    //"rm-alert"; //警告
    GetRowClassName({ row, rowIndex }) {
      if (row.stopflag == "1") {
        return "rm-disable"; //禁用
      }
      if (this.AddData.indexOf(row.rpt_itemcode) > -1) {
        return "row-new";
      }
      if (this.ModData.indexOf(row.rpt_itemcode) > -1) {
        return "row-modify";
      }
    },
    handleSelect() { },
    querySearch(queryString, cb) {
      var restaurants = this.tab_unitList;
      var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
      // 调用 callback 返回建议列表的数据
      cb(results);
    },
    createFilter(queryString) {
      return (restaurant) => {
        return restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0;
      };
    },
    async itemclassChange() {
      if (this.main_dialog_name == "新增") {
        try {
          const res = await this.$tool.request({
            url: "LIS/LIS1/LIS110",
            method: "post",
            data: {
              action: "AutoRptItemcode",
              itemclasscode: this.Tab_jbxx_Data_dialog.itemclasscode,
            },
          });
          this.Tab_jbxx_Data_dialog.rpt_itemcode = res.data;
          this.jbxx_rptitemcode_change();
        } catch (e) { }
      }
    },
    handleClick(tab, evt) {
      this.anchor = tab.name;
    }, //是不是可以去除勾选
    iscancelchk(e, name) {
      if (!e || e == "0") {
        this.$nextTick(async () => {
          const res = await this.$tool.request({
            url: "LIS/LIS1/LIS110",
            method: "post",
            data: {
              action: "iscancelchk",
              rpt_itemcode: this.Tab_jbxx_Data.rpt_itemcode,
              name: name,
            },
          });
          switch (name) {
            case "sex":
              this.Tab_jbxx_Data_dialog.ref_bysex = res.value == "1" ? true : false;
              break;
            case "age":
              this.Tab_jbxx_Data_dialog.ref_byage = res.value == "1" ? true : false;
              break;
            case "specimen":
              this.Tab_jbxx_Data_dialog.ref_byspecimen = res.value == "1" ? true : false;
              break;
            case "physicycle":
              this.Tab_jbxx_Data_dialog.ref_byphysicycle = res.value;
              break;
            case "diag":
              this.Tab_jbxx_Data_dialog.ref_bydiag = res.value;
              break;
            case "dept":
              this.Tab_jbxx_Data_dialog.ref_bydept = res.value;
              break;
          }
          if (res.msg != "") {
            this.$alert("该条数据在报告单元" + res.msg + "中有设定的参考值，不可取消勾选！", "提示", {
              confirmButtonText: "确定",
              confirmButtonClass: "el-button el-button--default el-button--small",
            });
          }
        });
      }
    },
    async English_sm() {
      if (this.Tab_jbxx_Data_dialog.itemcode_en != "" && !this.Tab_jbxx_Data_dialog.itemclasscode) {
        this.$alert("请选择项目归类！", "提示", {
          confirmButtonText: "确定",
          callback: (action) => {
            this.Tab_jbxx_Data_dialog.itemcode_en = "";
            this.$refs.itemclass.$refs.ddlrptitemclassSelect.focus();
          },
        });
        return false;
      }
      if (this.Tab_jbxx_Data_dialog.itemclasscode == "." && !!this.Tab_jbxx_Data_dialog.itemclasscode) {
        if (!this.Tab_jbxx_Data_dialog.rpt_itemcode) {
          this.Tab_jbxx_Data_dialog.rpt_itemcode = this.Tab_jbxx_Data_dialog.itemcode_en;
        }
        if (!this.Tab_jbxx_Data_dialog.rptcode) {
          this.Tab_jbxx_Data_dialog.rptcode = this.Tab_jbxx_Data_dialog.itemcode_en;
        }
      } else {
        if (!!this.Tab_jbxx_Data_dialog.itemclasscode && !!this.Tab_jbxx_Data_dialog.itemcode_en) {
          if (!this.Tab_jbxx_Data_dialog.rpt_itemcode) {
            await this.itemclassChange();
          }

          if (!this.Tab_jbxx_Data_dialog.rptcode) {
            this.Tab_jbxx_Data_dialog.rptcode = this.Tab_jbxx_Data_dialog.itemcode_en;
          }
        }
      }
    },
    ExportChangeEvent({ row }) {
      this.exportid = row.value;
    },
    tab_jbxx_exportEvent() {
      let p = {};
      if (this.exportid == "4") {
        this.ExportEventDiv = false;
        p = { prgno: "LIS110", pageinfo: "基本信息", style: "dat" };
        this.$pub.commexport(this, p, `报告项目维护.dat`);
        //window.open(this.$tool.baseUrl.replace(/api/, "z") + "filedownload?action=LIS110&file=报告项目维护&style=dat");
      } else if (this.exportid == "3") {
        p = { prgno: "LIS110", pageinfo: "基本信息", style: "xml", sql: this.ResSql };
        this.$pub.commexport(this, p, `报告项目维护.xml`);
        // window.open(this.$tool.baseUrl.replace(/api/, "z") + "filedownload?action=LIS110&file=报告项目维护&style=xml&sql=" + this.ResSql + "");
      } else if (this.exportid == "2") {
        let data = this.getExportData("2");
        let book = XLSX.utils.book_new();
        let sheet = XLSX.utils.json_to_sheet(data, { skipHeader: true });
        XLSX.utils.book_append_sheet(book, sheet);
        let wbout = XLSX.write(book, { bookType: "xlsx", bookSST: false, type: "binary" });
        let blob = new Blob([this.toBuffer(wbout)], { type: "application/octet-stream" });
        // 保存导出
        FileSaver.saveAs(blob, "LIS110报告项目.xlsx");
      } else if (this.exportid == "1") {
        let data = this.getExportData("1");
        let book = XLSX.utils.book_new();
        let sheet = XLSX.utils.json_to_sheet(data, { skipHeader: true });
        XLSX.utils.book_append_sheet(book, sheet);
        let wbout = XLSX.write(book, { bookType: "xlsx", bookSST: false, type: "binary" });
        let blob = new Blob([this.toBuffer(wbout)], { type: "application/octet-stream" });
        // 保存导出
        FileSaver.saveAs(blob, "LIS110报告项目.xlsx");
      } else {
        this.$message.error("请选择要导出的样式！");
      }
    },
    getExportData(index) {
      let code = ["rpt_itemcode", "rpt_itemname", "germflag", "itemclasscode", "instrclass", "itemcode_en", "itemname_en", "resulttype", "textresultflag", "unit", "dec_digits", "rptcode", "ref_l", "ref_h", "ref_text"];
      let datas = this.MainTableData;
      let columns = [];
      if (index == "1") {
        columns = this.tableColumn.filter((item) => code.indexOf(item.field) > -1);
      } else {
        columns = this.tableColumn.filter((item) => item.field);
      }
      let headers = [columns.map((item) => item.title)];
      return headers.concat(
        datas.map((row) => {
          return columns.map((column) => {
            return row[column.field];
          });
        })
      );
    },
    toBuffer(wbout) {
      let buf = new ArrayBuffer(wbout.length);
      let view = new Uint8Array(buf);
      for (let index = 0; index !== wbout.length; ++index) view[index] = wbout.charCodeAt(index) & 0xff;
      return buf;
    },
    EditClose({ row, column, rowIndex }) {
      // let arr = ["patsex", "ageyear1", "ageyear2"];
      // if (arr.includes(column.property)) {
      //     alert(column.property + "||" + rowIndex);
      //     this.$refs.tab_syqk2_Table.$refs.tableBody.$children[rowIndex].$refs.ddlmainSelect.focus();
      // }
    },
    jbxx_reftextFun(refval) {
      this.jbxx_ref_text = "";
      let k = "";
      if (refval) {
        k = refval.split("|");
        this.jbxx_ref_text = k.join("\n");
      }
      this.jbxx_reftext_dialogflag = true;
    },
    jbxx_reftext_saveevent() {
      let temp = this.jbxx_ref_text.split("\n");
      if (temp.length > 0) {
        temp = temp.filter((item) => item);
        this.Tab_jbxx_Data_dialog.ref_text = temp.join("|");
      } else {
        this.Tab_jbxx_Data_dialog.ref_text = this.jbxx_ref_text;
      }

      this.jbxx_reftext_dialogflag = false;
    },
    jbxx_reftext_cancelevent() {
      this.jbxx_reftext_dialogflag = false;
    },
    //控制参考值是否可编辑
    // activeMethod({ row, column }) {
    //     if (column.property == "patsex") {
    //         if (this.tab_ckzmx_bysex_if) {
    //             return true;
    //         } else {
    //             return false;
    //         }
    //     } else if (column.property == "specimen_code") {
    //         if (this.tab_ckzmx_byspecimen_if) {
    //             return true;
    //         } else {
    //             return false;
    //         }
    //     } else if (column.property == "physicycle") {
    //         if (this.tab_ckzmx_byphysicycle_if) {
    //             return true;
    //         } else {
    //             return false;
    //         }
    //     } else if (["ageyear1", "ageyear2"].includes(column.property)) {
    //         if (this.tab_ckzmx_byage_if) {
    //             return true;
    //         } else {
    //             return false;
    //         }
    //     } else if (column.property == "diag_icd") {
    //         if (this.tab_ckzmx_bydiag_if) {
    //             return true;
    //         } else {
    //             return false;
    //         }
    //     } else if (column.property == "deptno") {
    //         if (this.tab_ckzmx_bydept_if) {
    //             return true;
    //         } else {
    //             return false;
    //         }
    //     } else if (column.property == "seq") {
    //         return true;
    //     } else {
    //         return true;
    //     }
    // },
    //控制参考值颜色
    // cellClassName({ row, rowIndex, column, columnIndex }) {
    //     if (column.property === "patsex") {
    //         if (!this.tab_ckzmx_bysex_if) {
    //             return this.$pub.diseditcolumn();
    //         } else {
    //             return "";
    //         }
    //     } else if (column.property == "physicycle") {
    //         if (!this.tab_ckzmx_byphysicycle_if) {
    //             return this.$pub.diseditcolumn();
    //         } else {
    //             return "";
    //         }
    //     } else if (column.property == "specimen_code") {
    //         if (!this.tab_ckzmx_byspecimen_if) {
    //             return this.$pub.diseditcolumn();
    //         } else {
    //             return "";
    //         }
    //     } else if (["ageyear1", "ageyear2"].includes(column.property)) {
    //         if (!this.tab_ckzmx_byage_if) {
    //             return this.$pub.diseditcolumn();
    //         } else {
    //             return "";
    //         }
    //     } else if (column.property == "diag_icd") {
    //         if (!this.tab_ckzmx_bydiag_if) {
    //             return this.$pub.diseditcolumn();
    //         } else {
    //             return "";
    //         }
    //     } else if (column.property == "deptno") {
    //         if (!this.tab_ckzmx_bydept_if) {
    //             return this.$pub.diseditcolumn();
    //         } else {
    //             return "";
    //         }
    //     }
    // },
    wzjgRowClassName({ row, column }) {
      if (["H", "P"].includes(row.result_flag)) {
        return "row-HP";
      } else if (row.result_flag == "L") {
        return "row-L";
      } else if (row.result_flag == "Q") {
        return "row-Q";
      } else if (row.result_flag == "E") {
        return "row-E";
      } else {
        //M,N
        return "";
      }
    },
    //计算公式向导开窗
    async opendialogresult(flag) {
      try {
        this.resultflag = flag;
        const res = await this.$tool.request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "getRptitemResult",
            rpt_itemcode: this.Tab_jbxx_Data.rpt_itemcode,
          },
        });

        this.dialogResult = true;
        this.resultData = res.data;
        let k = "";
        if (flag == "1") {
          k = !this.Tab_jbxx_Data_dialog.result1formula ? "" : this.Tab_jbxx_Data_dialog.result1formula;
          this.result_text = XE.clone(k, true);
        } else if (flag == "2") {
          k = !this.Tab_jbxx_Data_dialog.result2formula ? "" : this.Tab_jbxx_Data_dialog.result2formula;
          this.result_text = XE.clone(k, true);
        } else {
          k = !this.Tab_jbxx_Data_dialog.result3formula ? "" : this.Tab_jbxx_Data_dialog.result3formula;
          this.result_text = XE.clone(k, true);
        }
      } catch (e) {
        this.$alert(e, "出错");
      }
    },
    result_iscalc_data_dbclick({ row, rowIndex, column }, event) {
      let tempstr = "";
      if (column.property == "result_str") {
        tempstr = "[@R] =" + '"' + row.result_str + '"' + " ";
      } else if (column.property == "result_num") {
        tempstr = "[R] =" + row.result_num + " ";
      }
      this.result_iscalc_addevent(tempstr);
    },
    result_iscalc_addevent(addstr) {
      if (addstr == "SEX1") {
        addstr = ' [SEX] = "1" ';
      }
      if (addstr == "SEX2") {
        addstr = ' [SEX] = "2" ';
      }
      var elInput = document.getElementById("result_calc_formula_id");
      var startPos = elInput.selectionStart;
      var endPos = elInput.selectionEnd;
      if (startPos === undefined || endPos === undefined) return;
      var txt = elInput.value;
      var result = txt.substring(0, startPos) + addstr + txt.substring(endPos);
      elInput.value = result; // 赋值给input的value
      // 重新定义光标位置
      elInput.focus();
      elInput.selectionStart = startPos + addstr.length;
      elInput.selectionEnd = startPos + addstr.length;
      this.result_text = result;
    },
    result_saveevent() {
      if (this.resultflag == "1") {
        this.Tab_jbxx_Data_dialog.result1formula = XE.clone(this.result_text, true);
      } else if (this.resultflag == "2") {
        this.Tab_jbxx_Data_dialog.result2formula = XE.clone(this.result_text, true);
      } else {
        this.Tab_jbxx_Data_dialog.result3formula = XE.clone(this.result_text, true);
      }
      this.dialogResult = false;
    }, //互斥项目
    mutexrptitemchange(code, name) {
      let data = this.$refs.tab_pcxm_Table.getTableData().fullData;
      if (data.length > 1) {
        let fdata = data.filter((m) => m.mutex_rptitemcodehid == code);
        if (fdata.length > 0) {
          this.$alert("所选互斥项目重复，该项目已加入互斥项目列表！", "信息");
          this.tab_pcxmrow.mutex_rptitemcode = "";
          this.tab_pcxmrow.mutex_rptitemcodehid = "";
          return false;
        } else {
          this.tab_pcxmrow.mutex_rptitemcode = code;
          this.tab_pcxmrow.mutex_rptitemcodehid = code;
        }
      } else {
        this.tab_pcxmrow.mutex_rptitemcode = code;
        this.tab_pcxmrow.mutex_rptitemcodehid = code;
      }
    }, //关联项目
    linkrptitemchange(code, name) {
      let data = this.$refs.tab_glxm_Table.getTableData().fullData;
      if (data.length > 1) {
        let fdata = data.filter((m) => m.link_rptitemcodehid == code);
        if (fdata.length > 0) {
          this.$alert("所选关联项目重复，该项目已加入关联项目列表！", "信息");
          this.tab_glxmrow.link_rptitemcode = "";
          this.tab_glxmrow.link_rptitemcodehid = "";
          return false;
        } else {
          this.tab_glxmrow.link_rptitemcode = code;
          this.tab_glxmrow.link_rptitemcodehid = code;
        }
      } else {
        this.tab_glxmrow.link_rptitemcode = code;
        this.tab_glxmrow.link_rptitemcodehid = code;
      }
    },
    tab_pcxmdblclick({ row, column }) {
      this.tab_pcxmrow = row;
    },
    tab_glxmdblclick({ row, column }) {
      this.tab_glxmrow = row;
    },
    jbxx_iscalcGuide_show() {
      this.Lab_CalcGuideloading = true;
      this.$tool
        .request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "getLab_CalcGuideData",
          },
        })
        .then((res) => {
          // this.CalcTestKey++;
          this.jbxx_iscalcGuide_dialog = true;
          this.CalcTestValue = "";
          this.Lab_CalcGuideData = res.Data;
          setTimeout(() => {
            this.$refs.plxTable.setCurrentRow(res.Data[0]);
          }, 10);
          this.Lab_CalcGuide_queryRight(res.Data[0]);
          this.Lab_CalcGuideloading = false;
        })
        .catch((e) => {
          this.Lab_CalcGuideloading = false;
          this.$alert(e, "出错");
        });
    },
    //常用计算公式向导导出按钮
    ExportCalcGuide() {
      let extableColumn = [];
      let tableColumn = this.$refs.plxTable.getColumns();
      tableColumn.forEach((item) => {
        extableColumn.push({ title: item.title, field: item.property });
      });
      this.$pub.exportTableExcel(this.Lab_CalcGuideData, extableColumn, "LIS110 计算项目公式向导.xlsx");
    },
    //常用计算公式向导计算测试
    CalcTest(e) {
      let result = "";
      let lsitem = "";
      this.verifyStr = XE.clone(this.calcGuide_calcformula, true);
      let data = this.$refs.prxTable.afterFullData;
      if (data.length > 0) {
        data.forEach((item) => {
          lsitem = item.calcformulaitem;
          result = item.testvalue;
          if (item.itemtype == "AA报告项目") {
            lsitem = "*" + item.calcformulaitem + "*";
          } else if (item.itemtype == "AGE") {
          } else {
            result = '"' + item.testvalue + '"';
          }
          lsitem = "[" + lsitem + "]";
          this.verifyStr = this.testHaveStr(this.verifyStr, lsitem, result);
        });
        if (e.shiftKey) {
          this.$alert(this.verifyStr, "信息");
        }
        this.$tool
          .request({
            url: "LIS/LIS1/LIS110",
            method: "post",
            data: {
              action: "CalcTest",
              verifyStr: this.verifyStr,
            },
          })
          .then((res) => {
            if (res.result != "" && res.result != "!" && res.result != "?") this.CalcTestValue = res.result;
            else this.CalcTestValue = "无结果";
          })
          .catch((e) => {
            this.$alert(e, "出错");
          });
      }
    }, //replace/g方法失效，所以拓展一个函数
    testHaveStr(verifyStr, lsitem, result) {
      if (verifyStr.indexOf(lsitem) > -1) {
        this.verifyStr = verifyStr.replace(lsitem, result);
        this.testHaveStr(this.verifyStr, lsitem, result);
      } else {
        return this.verifyStr;
      }
      return this.verifyStr;
    },
    //常用计算公式向导确定
    SureCalcGuide() {
      this.verifyStr = XE.clone(this.calcGuide_calcformula, true);
      let data = this.$refs.prxTable.afterFullData;
      if (data.length > 0) {
        for (let index = 0; index < data.length; index++) {
          const element = data[index];
          if (element.itemtype == "AA报告项目") {
            if (!element.rpt_itemcode) {
              this.$alert("还没有为[" + element.calcformulaitem + "]选择对应的报告项目！", "提示");
              return false;
            }
          }
          // const tempstr = element.rpt_itemcode + "$" + element.itemcode_en;
          // if (this.jbxx_iscalc_dataOri.indexOf(tempstr) == -1) {
          //     this.jbxx_iscalc_dataOri.push(tempstr);
          // }
          this.verifyStr = this.testHaveStr(this.verifyStr, "*" + element.calcformulaitem + "*", element.rpt_itemcode);
        }
        this.jbxx_iscalcGuide_dialog = false;
        this.jbxx_s_calc_formula = XE.clone(this.verifyStr, true);
        this.jbxx_iscalc_formula_textchange();
      }
    },
    //常用计算公式向导左边列表行切换
    currentCalcGuideChangeEvent({ row }) {
      this.CalcTestValue = "";
      this.Lab_CalcGuide_queryRight(row);
    },
    //常用计算公式向导右边列表显示
    Lab_CalcGuide_queryRight(row) {
      this.Lab_CalcItemData = [];
      let data = row.calcformula;
      this.calcGuide_calcformula = XE.clone(data, true);
      const set = new Set(data.match(/\[(.+?)\]/g));
      let ArrStr = [...set];
      ArrStr.forEach((item) => {
        let tmpstr = "";
        if (item.indexOf("*") > -1) {
          tmpstr = item.substring(2, item.length - 2);
          this.Lab_CalcItemData.push({ calcformulaitem: tmpstr, itemtype: "AA报告项目" });
        } else {
          tmpstr = item.substring(1, item.length - 1);
          this.Lab_CalcItemData.push({ calcformulaitem: tmpstr, itemtype: tmpstr });
        }
      });
      this.Lab_CalcItemData.sort((a, b) => {
        return a.itemtype.localeCompare(b.itemtype, "zh-Hans-CN", { sensitivity: "accent" });
      });
    }, //常用计算公式报告项目弹窗查询
    calcGuideDblclick({ row, column }) {
      if (column.property != "testvalue") {
        if (row.calcformulaitem != "SEX" && row.calcformulaitem != "AGE") {
          this.calcGuideRptitemRow = row;
          this.calcguide = {};
          this.calcGuideQueryRptitem();
        }
      }
    }, //常用计算公式报告按钮查询
    calcGuideQueryRptitem() {
      this.Lab_CalcrptItemLoading = true;
      this.dialogrptitem = true;
      this.$tool
        .request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "lab_rptitem_query",
            itemclasscode: this.calcguide.itemclasscode,
            rptunitid: this.calcguide.rptunitid,
            keystr: this.calcguide.txtsearch,
          },
        })
        .then((res) => {
          this.Lab_CalcrptItemLoading = false;
          this.Lab_CalcrptItemData = res.RData.Data;
          setTimeout(() => {
            this.$refs.plxTable.setCurrentRow(res.RData.Data[0]);
          }, 10);
        })
        .catch((e) => {
          this.Lab_CalcrptItemLoading = true;
          this.$alert(e, "出错");
        });
    }, //常用计算公式报告项目双击确定或按钮确定
    calcGuideSureRptitem() {
      var curRow = this.$refs.rptitemTable.getCurrentRow();
      this.calcGuideRptitemRow.rpt_itemname = curRow.rpt_itemname;
      this.calcGuideRptitemRow.rpt_itemcode = curRow.rpt_itemcode;
      this.calcGuideRptitemRow.unit = curRow.unit;
      this.calcGuideRptitemRow.ref_text = curRow.ref_text;
      this.calcGuideRptitemRow.testmethod = curRow.testmethod;
      this.calcGuideRptitemRow.itemcode_en = curRow.itemcode_en;
      this.$refs.prxTable.updateListenter();
      this.dialogrptitem = false;
    },
    //诊断icd双击开窗
    // diag_icdOpen({ row, column }, $event) {
    //     this.diag_icd_reftextRow = row;
    //     if (this.tab_ckzmx_bydiag_if) {
    //         if (column.property == "diag_icd") {
    //             this.dialogdiagicd = true;
    //         }
    //     }
    //     if (this.tab_ckzmx_bydept_if) {
    //         if (column.property == "deptno") {
    //             this.dialogdeptno = true;
    //         }
    //     }
    //     if (column.property == "ref_text") {
    //         //弹窗显示多行参考值的文本编辑
    //         let refval = row.ref_text;
    //         this.val_ref_text = "";
    //         let k = "";
    //         if (!!refval) {
    //             k = refval.split("|");
    //             this.val_ref_text = k.join("\n");
    //         }
    //         this.reftext_dialog = true;
    //     }
    // },
    //多行参考值文本编辑闭窗赋值
    reftext_saveevent() {
      let temp = this.val_ref_text.split("\n");
      if (temp.length > 0) {
        temp = temp.filter((item) => item);
        this.diag_icd_reftextRow.ref_text = temp.join("|");
      } else {
        this.diag_icd_reftextRow.ref_text = this.val_ref_text;
      }
      this.reftext_dialog = false;
    },
    //诊断ICD相关修改
    // diagicdChange(code, name, row) {
    //     this.diag_icd_reftextRow.diag_icd = row.ICD10编码;
    //     this.dialogdiagicd = false;
    // },
    //科室相关修改
    // deptChange(code, name, row) {
    //     this.diag_icd_reftextRow.deptno = code;
    //     this.dialogdeptno = false;
    // },
    //菌属标志改变
    isgermgroupChange() {
      if (this.Tab_jbxx_Data_dialog.isgermgroup) {
        this.disabledKindGroup = false;
      } else {
        this.disabledKindGroup = true;
      }
    }, //菌属(三级分类)改变同时改变二级分类和一级分类
    germgroupChange(code, name) {
      this.getGermgroup(code, "kind")
        .then((res) => {
          this.Tab_jbxx_Data_dialog.germkind = res;
          this.getGermgroup(res, "gram")
            .then((resp) => {
              this.Tab_jbxx_Data_dialog.germgram = resp;
            })
            .catch((e) => {
              this.$alert(e, "出错");
            });
        })
        .catch((e) => {
          this.$alert(e, "出错");
        });
    },
    SelectInputChange(val) {
      this.Tab_jbxx_Data_dialog.defaultval = val.target.value;
    },
    //菌科(二级分类)改变找一级分类
    germkindChange(code, name, row) {
      this.Tab_jbxx_Data_dialog.germgram = row.所属大类;
      this.Tab_jbxx_Data_dialog.germkind = code;
      this.$forceUpdate();
    },
    getGermgroup(code, type) {
      return new Promise((s, f) => {
        this.$tool
          .request({
            url: "LIS/LIS1/LIS110",
            method: "post",
            data: {
              action: "getGermgroupKind",
              code: code,
              type: type,
            },
          })
          .then((res) => {
            s(res);
          })
          .catch((e) => {
            f(e);
          });
      });
    },
    compitemcodeChange(code, name) {
      if (this.Tab_jbxx_Data_dialog.rpt_itemcode == code) {
        this.Tab_jbxx_Data_dialog.comp_itemcode = XE.clone(this.oldcompitemcode, true);
        this.$alert("不能选择自己作为对照项目", "提示");
        return false;
      }
    },
    //计算项目计算公式向导---帮助
    calctestfun(flag) {
      if (flag == "doc") {
        //打开帮助文档
        this.$tool
          .request({
            url: "LIS/LIS1/LIS110",
            method: "post",
            data: {
              action: "OpenHelpDoc",
            },
          })
          .then((res) => {
            if (res.errcode != "1") {
              this.$alert(res.errmsg, "提示");
            }
          })
          .catch((e) => {
            this.$alert(e, "出错");
          });
      } else {
        //计算测试
        this.$tool
          .request({
            url: "LIS/LIS1/LIS110",
            method: "post",
            data: {
              action: "CalcTest",
              verifyStr: this.calctestObj.teststr,
            },
          })
          .then((res) => {
            if (res.errcode == "1") {
              if (res.result != "" && res.result != "!" && res.result != "?") this.calctestObj.testvalue = res.result;
              else this.calctestObj.testvalue = "无结果";
            } else {
              this.calctestObj.testvalue = "无结果" + "\r\n" + res.errmsg;
            }
          })
          .catch((e) => {
            this.$alert(e, "出错");
          });
      }
    },
    importRptitem() {
      this.importRptitemDialog = true;
    },
    chooseRptmodel() {
      let modelrow = this.$refs.rptmodelTable.getCurrentRow();
      if (!modelrow) return false;
      if (modelrow.value == "1") {
        //导入Excel
        let msgtext = `<div>支持从Excel中导入项目信息，如果代码已经存在会自动忽略，具体文件格式</div>
                              <div style='margin-bottom: 10px;'>如下：</div>
                              <div>1-5列：项目代码，项目名称，细菌标识，项目归类，仪器大类</div>
                              <div>6-10列：英文缩写，英文名称，结果类型，默认文字结果标志，单位</div>
                              <div>11-15列：小数位数，打印代码，参考下限，参考上限，参考范围</div>`;
        this.$confirm(msgtext, "提示", {
          confirmButtonText: "确定",
          showCancelButton: false,
          dangerouslyUseHTMLString: true,
          customClass: "import-rpt-msgbox",
          type: "warning",
        })
          .then(() => {
            this.exeimportRptDialog = true;
            this.$refs["upload"].$refs["upload-inner"].handleClick();
          })
          .catch(() => { });
      } else if (modelrow.value == "2") {
        //导入细菌字典
        let msgtext = "你是否要导入细菌字典？";
        this.$confirm(msgtext, "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            this.getMatchrptList();
            this.exeimportMatchRptDialog = true;
            //this.jbxx_iscalcGuide_dialog=true;
          })
          .catch(() => { });
      } else if (modelrow.value == "3") {
        //导入dat文件
        let msgtext = "导入将导致当前系统所有报告项目丢失，你是否要继续？";
        this.$confirm(msgtext, "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            this.uploadpasswordVisible = true;
            this.uploadpassword = "";
          })
          .catch(() => { });
      }
    },
    getMatchrptList() {
      this.$tool
        .request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "lab_rptitem_ImportMatch",
          },
        })
        .then((res) => {
          this.MatchrptList = res.data;
        })
        .catch((e) => { });
    },
    btnimportMatch() {
      let msgtext = `<div>导入文件为Excel文件格式，各个列应当依次为：</div>
                              <div style='margin-bottom: 10px;'>如下：</div>
                              <div>1：细菌代码</div>
                              <div>2：中文名称</div>
                              <div>3：英文名称</div>
                              <div>4：革兰氏性质Gram(+,-,f,m,a,o等取值)</div>
                              <div>5：细菌分类</div>
                              <div>6：所属菌属</div>
                              <div>7：菌属标志(1=菌属，0=细菌)</div>
                              <div>8：Whonet代码</div>
                              <div>9：项目归类</div>
                              <div>10：仪器大类</div>`;
      this.$confirm(msgtext, "提示", {
        confirmButtonText: "确定",
        showCancelButton: false,
        dangerouslyUseHTMLString: true,
        customClass: "import-rpt-msgbox",
        type: "warning",
      })
        .then(() => {
          this.$refs["uploadmatch"].$refs["upload-inner"].handleClick();
        })
        .catch(() => { });
    },
    uploadpasswordSure() {
      //console.log(this.uploadpassword);
      if (this.uploadpassword == "导入") {
        this.uploadpasswordVisible = false;
        this.fileimportnotifyVisible = true;
        this.fileimportform.file = "";
        this.fileList = [];
        //this.percentage = 0;
      }
    },
    uploadMatchOpt(content) {
      let formData = new FormData();
      formData.append("action", "LIS110-excelmatch");
      formData.append("file", content.file);
      formData.append("CHNMatchCoverEN", this.CHNMatchCoverEN);
      formData.append("ENMatchCoverCHN", this.ENMatchCoverCHN);
      var URL = this.$tool.baseUrl.replace("api", "z") + "fileupload";
      axios
        .post(URL, formData, { "Content-Type": "multipart/form-data" })
        .then((res) => {
          let response = res.data;
          if (response.flag == 1) {
            this.$notify.success({
              title: "成功",
              message: `文件上传成功`,
            });
            console.log("response", response);
            this.importMatchrptList = XEUtils.clone(response.data, true);
            this.tempimportMatchrptList = XEUtils.clone(response.data, true);
            this.$refs.importMatchrptTable.loadData(this.importMatchrptList);
            this.importNumtext = this.importMatchrptList.length;
          } else {
            this.$notify.error({
              title: "错误",
              message: response.msg,
            });
          }
        })
        .catch((e) => {
          this.$alert(e, "出错");
        });
    },
    changeupdatetype() {
      if (this.importMatchrptList.length > 0) {
        this.importMatchrptList.forEach((element) => {
          if (this.CHNMatchCoverEN == "1") {
            if (element.presentitemname == element.importitemname && element.presentitemname_en != element.importitemname_en) {
              element.updatetype = "更新英文名称";
            } else {
              element.updatetype = "忽略";
              if (this.ENMatchCoverCHN == "1") {
                if (element.presentitemname != element.importitemname && element.presentitemname_en == element.importitemname_en) {
                  element.updatetype = "更新中文名称";
                }
              }
            }
          } else if (this.CHNMatchCoverEN == "0" && this.ENMatchCoverCHN == "1") {
            if (element.presentitemname != element.importitemname && element.presentitemname_en == element.importitemname_en) {
              element.updatetype = "更新中文名称";
            } else {
              element.updatetype = "忽略";
            }
          } else {
            element.updatetype = "忽略";
          }
          if (element.presentitemname != element.importitemname && element.presentitemname_en != element.importitemname_en) {
            element.updatetype = "新增";
          }
        });
        this.$refs.importMatchrptTable.loadData(this.importMatchrptList);
      }
    },
    changeonlyshowupdate() {
      if (this.showonlyupdate == "1") {
        if (this.importMatchrptList.length > 0) {
          var showonlyupdateList = this.importMatchrptList.filter((item) => item.updatetype != "忽略");
          this.$refs.importMatchrptTable.loadData(showonlyupdateList);
          this.importNumtext = showonlyupdateList.length;
        }
      } else {
        this.$refs.importMatchrptTable.loadData(this.importMatchrptList);
        this.importNumtext = this.importMatchrptList.length;
      }
    },
    importrptitemclassChange(code, name) {
      this.import_itemclasscode = code;
    },
    importinstrclassChange(code, name) {
      this.import_instrclass = code;
    },
    saveRptimportMatch() {
      var showonlyupdateList = this.importMatchrptList.filter((item) => item.updatetype != "忽略");

      if (showonlyupdateList.length > 0) {
        var updatenum = showonlyupdateList.length;
        this.$confirm("更新" + updatenum + "条数据", "提示", {
          confirmButtonText: "确定",
          showCancelButton: false,
          dangerouslyUseHTMLString: true,
          type: "warning",
        })
          .then(() => {
            this.savedata();
          })
          .catch(() => { });
      } else {
        this.$alert("没有要更新的数据！", "提示");
      }
    },
    savedata() {
      this.$tool
        .request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "excelImportMatch",
            data: this.importMatchrptList,
            itemclasscode: this.import_itemclasscode,
            instrclass: this.import_instrclass,
          },
        })
        .then((response) => {
          if (response.flag == "1") {
            this.$pub.message(this, "保存成功！", "success");
            this.clearImportMatchdata();
            this.importRptitemDialog = false;
          } else {
            this.$pub.message(this, response.msg, "warning");
          }
        })
        .catch((e) => {
          this.$alert(e, "出错");
        });
    },
    uploadOpt(content) {
      let formData = new FormData();
      formData.append("action", "LIS110-excel");
      formData.append("file", content.file);
      var URL = this.$tool.baseUrl.replace("api", "z") + "fileupload";
      axios
        .post(URL, formData, { "Content-Type": "multipart/form-data" })
        .then((res) => {
          let response = res.data;
          if (response.flag == 1) {
            this.$notify.success({
              title: "成功",
              message: `文件上传成功`,
            });
            this.fimportrptList = XEUtils.clone(response.data, true);
            this.importrptList = XEUtils.clone(response.data, true);
            this.$refs.importrptTable.loadData(this.importrptList);
            this.importNumtext = response.msg;
          } else {
            this.$notify.error({
              title: "错误",
              message: response.msg,
            });
          }
        })
        .catch((e) => {
          this.$alert(e, "出错");
        });
    },
    // 文件状态改变时的钩子
    fileChange(file, fileList) {
      this.form.file = file.raw;
    },
    // 文件超出个数限制时的钩子
    exceedFile(files, fileList) {
      this.$notify.warning({
        title: "警告",
        message: `只能选择 ${this.limitNum} 个文件，当前共选择了 ${files.length + fileList.length} 个`,
      });
    },
    // 文件状态改变时的钩子
    fileimportChange(file, fileList) {
      this.fileimportform.file = file.raw;
    },
    // 上传文件之前的钩子, 参数为上传的文件,若返回 false 或者返回 Promise 且被 reject，则停止上传
    beforeUploadFile(file) {
      let extension = file.name.substring(file.name.lastIndexOf(".") + 1);
      let size = file.size / 1024 / 1024;
      if (extension !== "dat") {
        this.$notify.warning({
          title: "警告",
          message: `只能上传DAT(*dat)文件，且不超过10M`,
        });
      }
      if (size > 10) {
        this.$notify.warning({
          title: "警告",
          message: `文件大小不得超过10M`,
        });
      }
    },
    uploadFile() {
      if (this.fileimportform.file) {
        this.MainTableData = [];
        const loading = this.$loading({
          // 声明一个loading对象
          lock: true, // 是否锁屏
          text: "正在导入报告项目，请稍候……", // 加载动画的文字
          spinner: "el-icon-loading", // 引入的loading图标
          background: "rgba(0, 0, 0, 0.3)", // 背景颜色
          target: ".sub-main", // 需要遮罩的区域
          body: true,
          customClass: "mask", // 遮罩层新增类名
        });
        var URL = this.$tool.baseUrl.replace("api", "z") + "fileupload";
        let formData = new FormData();
        formData.append("file", this.fileimportform.file);
        formData.append("action", "LIS110-dat");
        formData.append("isoverrideall", this.isoverride);
        axios
          .post(URL, formData, { "Content-Type": "multipart/form-data" })
          .then((res) => {
            loading.close();
            if (res.status == 200) {
              let response = res.data;
              if (response.flag == "1") {
                this.$notify.success({
                  title: "成功",
                  message: `文件上传成功`,
                });
                this.fileimportnotifyVisible = false;
              } else {
                this.$notify.error({
                  title: "错误",
                  message: `文件上传失败`,
                });
                this.fileimportnotifyVisible = true;
              }
            } else {
              this.$notify.error({
                title: "错误",
                message: `文件上传失败`,
              });
              this.fileimportnotifyVisible = true;
            }
            this.MainTable_Rfresh();
          })
          .catch((e) => {
            console.log("error", e);
          });
      } else {
        this.$alert("请先选择文件再上传！");
      }
    },
    // getuploadprogress(alldatalength, nowlength) {
    //      if(nowlength < alldatalength){
    //         this.$tool.request({
    //                 url: "LIS/LIS1/LIS110",
    //                 method: "post",
    //                 timeout: 600000,
    //                 data: {
    //                     action: "querynowdatalength",
    //                 },
    //             })
    //             .then((res) => {
    //                 nowlength = res;
    //                 this.percentage = parseInt((nowlength / alldatalength.length) * 100);
    //                 this.getuploadprogress(alldatalength, nowlength);
    //             })
    //             .catch((e) => {
    //                 console.log(e);
    //             });
    //      }
    //      else{
    //          this.percentage = 100;
    //      }
    // },
    deleteRptrow() {
      let delrow = this.$refs.importrptTable.getCurrentRow();
      if (!delrow) return false;
      this.$confirm("你确定删除这笔记录?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          var delrow = this.$refs.importrptTable.getCurrentRow();
          var rowindex = this.$refs.importrptTable.getTableData().fullData.indexOf(delrow);
          this.importrptList.splice(rowindex, 1);
          this.$refs.importrptTable.loadData(this.importrptList).then(() => {
            var havedata = this.$refs.importrptTable.getTableData().fullData;
            if (havedata.length > 0) {
              if (rowindex >= havedata.length) rowindex = havedata.length - 1;
              // this.fbactPurposeList = XEUtils.clone(havedata, true);
              let selectrow = havedata[rowindex];
              this.$refs.importrptTable.setCurrentRow(selectrow);
            }
          });
        })
        .catch(() => { });
    },
    saveRptimport() {
      this.$tool
        .request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "excelImport",
            data: this.importrptList,
          },
        })
        .then((response) => {
          if (response.flag == "1") {
            this.$pub.message(this, "保存成功！", "success");
            this.exeimportRptDialog = false;
            this.importRptitemDialog = false;
          } else {
            this.$pub.message(this, response.msg, "warning");
          }
        })
        .catch((e) => {
          this.$alert(e, "出错");
        });
    },
    cancelDatachange() {
      this.$confirm("你确定要取消这次改动?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.importrptList = XEUtils.clone(this.fimportrptList, true);
          this.$refs.importrptTable.loadData(this.importrptList);
        })
        .catch(() => { });
    },
    clearImportdata() {
      // this.$refs.importrptTable.loadData();
      this.exeimportRptDialog = false;
      this.fimportrptList = [];
      this.importrptList = [];
      this.importNumtext = "";
    },
    clearImportMatchdata() {
      this.exeimportMatchRptDialog = false;
      this.importMatchrptList = [];
      this.importNumtext = "";
      this.CHNMatchCoverEN = "1";
      this.ENMatchCoverCHN = "1";
    },
    //更新使用频次
    updateUseFrequency() {
      const loading = this.$loading({
        // 声明一个loading对象
        lock: true, // 是否锁屏
        text: "正在更新使用频次，请稍候……", // 加载动画的文字
        spinner: "el-icon-loading", // 引入的loading图标
        background: "rgba(0, 0, 0, 0.3)", // 背景颜色
        target: ".sub-main", // 需要遮罩的区域
        body: true,
        customClass: "mask", // 遮罩层新增类名
      });
      this.$tool
        .request({
          url: "LIS/LIS1/LIS110",
          method: "post",
          data: {
            action: "updateUseFrequency",
          },
        })
        .then((response) => {
          if (response.errcode == "1") {
            this.$pub.message(this, "使用频次已更新,请查看！", "success");
            loading.close();
          } else {
            this.$alert(response.msg, "提示");
            loading.close();
          }
        })
        .catch((e) => {
          this.$alert(e, "出错");
          loading.close();
        });
    },
    //外部代码复制保存
    CopyExcodeSave() {
      if (this.CopyExcode.Orihospcode != "") {
        this.$tool
          .request({
            url: "ucent/liscomm", //"LIS/LIS1/LIS110",
            method: "post",
            data: {
              action: "CopyExcodeSave",
              Orihospcode: this.CopyExcode.Orihospcode,
            },
          })
          .then((response) => {
            if (response.errcode == "1") {
              this.$pub.message(this, "所选医院外部代码复制已保存成功,请查看！", "success");
              this.CopyExcode.dialogCopyExcode = false;
            } else {
              this.$alert(response.msg, "提示");
            }
          })
          .catch((e) => {
            this.$alert(e, "出错");
          });
      } else {
        this.$alert("请先选择来源医院！", "提示");
      }
    },
    //计算公式帮助文档
    calchelpdoc() {
      let p = { prgno: "LIS110", pageinfo: "帮助文档", style: "DOCX" };
      this.$pub.commexport(this, p, `计算公式函数说明.docx`);
    },
  },
};
</script>

<style scoped>
::v-deep  .el-checkbox__inner::after {
  border: 2px solid #000000 !important;
  box-sizing: content-box;
  content: "";
  border-left: 0 !important;
  border-top: 0 !important;
  height: 7px;
  left: 4px;
  position: absolute;
  top: 1px;
  transform: rotate(45deg) scaleY(0);
  width: 3px;
  transition: transform 0.15s ease-in 0.05s;
  transform-origin: center;
}

::v-deep  .el-checkbox__input.is-disabled+span.el-checkbox__label {
  color: #000000;
  cursor: not-allowed;
}

::v-deep   .el-checkbox__input.is-disabled .el-checkbox__inner,
.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner+.el-input.is-disabled .el-input__inner {
  background-color: #ffffff !important;
}

::v-deep   .mystyle tr.vxe-body--row.row-new {
  color: #cc6600;
}

::v-deep   .mystyle tr.vxe-body--row.row-modify {
  color: blue !important;
}

::v-deep   .wzjgstyle .vxe-body--row.row-HP {
  background-color: RGB(255, 192, 192);
}

::v-deep   .wzjgstyle .vxe-body--row.row-E {
  background-color: RGB(219, 112, 147);
}

::v-deep   .wzjgstyle .vxe-body--row.row-L {
  background-color: RGB(192, 192, 255);
}

::v-deep   .wzjgstyle .vxe-body--row.row-Q {
  background-color: RGB(255, 255, 192);
}

.pagetop {
  left: 0;
  right: 0;
  height: 100px;
  display: -webkit-box;
  -webkit-box-pack: center;
  -webkit-box-align: center;
  border: solid 1px #ccc;
  position: absolute;
  z-index: 99;
}

.pagecenter {
  position: absolute;
  top: 105px;
  width: 100%;
  left: 0;
  bottom: 0px;
  overflow: auto;
}

.middle-center {
  position: absolute;
  height: 100%;
  right: 805px;
  left: 0;
  overflow: auto;
}

.middle-right {
  position: absolute;
  top: 0;
  bottom: 0px;
  overflow: visible;
  width: 800px;
  right: 0px;
}

table tr td:nth-child(odd) {
  text-align: right;
  white-space: nowrap;
}

table tr td:nth-child(even) {
  text-align: left;
}

table tr td:nth-child(1) {
  width: 80px;
}

table {
  font-size: 12px;
  border-collapse: separate;
  border-spacing: 5px;
}

.upload-demo {
  margin-left: 8px;
  margin-right: 8px;
}

.scroll_title {
  text-align: left;
  height: 500px;
  width: 100%;
  overflow: auto;
}

::v-deep  .mytablestyle tr td div .el-input__inner {
  border: 1px solid rgba(255, 254, 254, 0) !important;
  background-color: rgba(255, 254, 254, 0) !important;
}

::v-deep   .righttablist .el-tabs__item {
  padding: 0px 10px !important;
}

.importrpt-model {
  display: flex;
  justify-content: space-between;
  height: 250px;
}

.importrpt-modelbtn {
  margin: auto;
}

.importrpt-modelbtn div {
  margin: 20px 0;
}

.upload-button {
  height: 24px;
  margin: 0 10px;
  display: none;
}

.upload-button div {
  height: 24px;
}

::v-deep   .upload-button .el-upload--text {
  border: 0 !important;
  border-radius: 3px !important;
}

.import-top {
  display: flex;
  justify-content: space-between;
}

.import-top-info {
  margin: 0 5px;
}

.import-top-info span {
  margin-right: 10px;
  font-weight: bold;
  font-size: 13px;
  color: #000000;
  line-height: 26px;
}

.import-top-btn {
  text-align: right;
}</style>
